← All courses
SQL: Zero to Production
Learn SQL from the ground up: query data, create tables, and change data, then joins, aggregation, subqueries, window functions and more. Run and edit the SQL from every module right in your browser, with a graded exercise in every lesson.
beginner
Free
sqlpostgresqldatabases
14 modules · 55 lessons
▸
0. SQL Foundations
2 lessons · 7 min
-
1
What is SQL?
3 min
-
2
How SQL runs a query
4 min
▸
1. Querying Basics
5 lessons · 22 min
-
3
SELECT: choosing columns
5 min
-
4
WHERE: keeping only the rows you want
5 min
-
5
Sorting and limiting results
5 min
-
6
NULL: the "unknown" value
4 min
-
7
CASE and changing types
3 min
▸
2. Creating Tables (DDL)
4 lessons · 18 min
-
8
Choosing column types
4 min
-
9
CREATE TABLE
4 min
-
10
Constraints: rules the data must follow
4 min
-
11
Changing tables and linking them
6 min
▸
3. Changing Data (DML)
4 lessons · 19 min
-
12
INSERT: adding rows
5 min
-
13
UPDATE: changing rows
5 min
-
14
DELETE: removing rows
4 min
-
15
UPSERT and RETURNING
5 min
▸
4. Joins & Set Operations
5 lessons · 42 min
-
16
INNER JOIN: combining rows across tables
9 min
-
17
OUTER JOIN: keeping the rows that don't match
9 min
-
18
CROSS JOIN and self-joins
8 min
-
19
Set operations: UNION, INTERSECT, EXCEPT
8 min
-
20
Join fan-out: diagnosing row-multiplication bugs
8 min
▸
5. Aggregation & Grouping
4 lessons · 32 min
-
21
Aggregate functions: COUNT, SUM, AVG and friends
8 min
-
22
GROUP BY and HAVING
8 min
-
23
GROUPING SETS, ROLLUP, CUBE
9 min
-
24
FILTER and conditional aggregation
7 min
▸
6. Subqueries & CTEs
4 lessons · 32 min
-
25
Scalar and correlated subqueries
10 min
-
26
Subqueries in SELECT/FROM/WHERE, derived tables
7 min
-
27
Common table expressions: WITH
7 min
-
28
Recursive CTEs: hierarchies and graphs
8 min
▸
7. Window Functions
5 lessons · 43 min
-
29
Window functions: OVER and PARTITION BY
8 min
-
30
Ranking: ROW_NUMBER, RANK, DENSE_RANK, NTILE
7 min
-
31
Window frames: ROWS vs RANGE
10 min
-
32
Analytic functions: LAG, LEAD, FIRST_VALUE
9 min
-
33
Practical patterns: dedup with ROW_NUMBER, top-N per group, gaps & islands
9 min
▸
8. Data Modeling
2 lessons · 18 min
-
34
ER modeling: entities, relationships, cardinality
7 min
-
35
Normalization: 1NF, 2NF, 3NF, and when to denormalize
11 min
▸
9. Views & Reusable SQL
4 lessons · 31 min
-
36
Views and materialized views
8 min
-
37
PL/pgSQL basics: going beyond plain SQL
8 min
-
38
Procedures and triggers
8 min
-
39
Error handling: RAISE and EXCEPTION blocks
7 min
▸
10. Indexes & Performance
5 lessons · 50 min
-
40
EXPLAIN ANALYZE: reading query plans
10 min
-
41
B-tree indexes
11 min
-
42
Other index types: Hash, GIN, GiST, BRIN — what each is for
11 min
-
43
Composite and partial indexes
9 min
-
44
Common performance killers: missing index, function-wrapped columns, implicit casts
9 min
▸
11. JSON, Arrays & Full-Text Search
4 lessons · 34 min
-
45
JSON and JSONB
10 min
-
46
Arrays: multiple values in one column
8 min
-
47
Full-text search: tsvector and tsquery
8 min
-
48
Extensions: pg_trgm, PostGIS, pg_stat_statements
8 min
▸
12. Transactions & Concurrency
3 lessons · 27 min
-
49
Transactions and ACID
9 min
-
50
Isolation levels
9 min
-
51
Locking and deadlocks
9 min
▸
13. Capstones
4 lessons · 33 min
-
52
Capstone: design a normalized schema
8 min
-
53
Capstone: an analytics report suite
8 min
-
54
Capstone: tune a slow query
8 min
-
55
Capstone: the database layer for an app
9 min
0 Comments