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

0 Comments