← 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 graded exercises in the foundation modules.

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

0 Comments