Learn SQL
Work top to bottom, or jump to a track. Each lesson pairs a short explanation with exercises you run right here in the browser, with hints and solutions when you get stuck.
Foundations
Start here — the essentials, in order.0/21010/4Welcome to the Shed
What SQL is · the workbench · your first SELECT
Lessons
Welcome to the Shed
What SQL is · the workbench · your first SELECT
020/6Data Types Before Deep Querying
Numbers · strings · dates · booleans · nulls
Lessons
Data Types Before Deep Querying
Numbers · strings · dates · booleans · nulls
030/7Select, Filter, and Sort
WHERE · AND/OR · IN · BETWEEN · LIKE · ORDER BY
Lessons
Select, Filter, and Sort
WHERE · AND/OR · IN · BETWEEN · LIKE · ORDER BY
040/4Aggregations and Grouping
COUNT · SUM · AVG · GROUP BY · HAVING
Lessons
Aggregations and Grouping
COUNT · SUM · AVG · GROUP BY · HAVING
Joins & Logic
Combine tables and shape your output.0/12050/4Joins
INNER · LEFT · self-joins · multiplication
Lessons
Joins
INNER · LEFT · self-joins · multiplication
060/4CASE Logic and Derived Columns
Calculated columns · CASE WHEN · COALESCE
Lessons
CASE Logic and Derived Columns
Calculated columns · CASE WHEN · COALESCE
070/4Dates, Strings, and Nulls in Practice
Date math · string cleanup · safe null handling
Lessons
Dates, Strings, and Nulls in Practice
Date math · string cleanup · safe null handling
Change & Debug
Edit data safely, then fix what breaks.0/9080/5DML: Measure Twice, Cut Once
INSERT · UPDATE · DELETE · transactions
Lessons
DML: Measure Twice, Cut Once
INSERT · UPDATE · DELETE · transactions
090/4Query Debugging and Common Mistakes
Reading errors · wrong answers without errors
Lessons
Query Debugging and Common Mistakes
Reading errors · wrong answers without errors
Analytics & Applied Practice
Real reporting on full datasets.0/22100/6Practical Analytics Patterns
Top-N · rates · cohorts · windows · CTEs
Lessons
Practical Analytics Patterns
Top-N · rates · cohorts · windows · CTEs
110/6Applied Practice: Movie Rentals
Reapply joins · aggregates · dates · nulls on a fresh dataset
Lessons
Applied Practice: Movie Rentals
Reapply joins · aggregates · dates · nulls on a fresh dataset
120/6Applied Practice: Website Analytics
Funnels · attribution · conversion rates on a marketing dataset
Lessons
Applied Practice: Website Analytics
Funnels · attribution · conversion rates on a marketing dataset
130/4Applied Practice: Store Operations
Revenue · inventory · customer value · supplier margin
Lessons
Applied Practice: Store Operations
Revenue · inventory · customer value · supplier margin
Advanced
Subqueries, sets, pivots, missions, and modeling.0/27140/4Subqueries and EXISTS
Nested SELECTs · IN · EXISTS · correlated checks
Lessons
Subqueries and EXISTS
Nested SELECTs · IN · EXISTS · correlated checks
150/4Set Operations
UNION ALL · UNION · INTERSECT · EXCEPT
Lessons
Set Operations
UNION ALL · UNION · INTERSECT · EXCEPT
160/6Summary Reports & Pivots
Conditional aggregation · ROLLUP subtotals · STRING_AGG · CASE buckets
Lessons
Summary Reports & Pivots
Conditional aggregation · ROLLUP subtotals · STRING_AGG · CASE buckets
170/8Guided Playground Missions
Dataset scouting · revenue audits · scorecards · conversion reports
Lessons
Guided Playground Missions
Dataset scouting · revenue audits · scorecards · conversion reports
180/5Modeling and Data Quality
Profiling · quality checks · semantic views · staging · rerunnable scripts
Lessons
Modeling and Data Quality
Profiling · quality checks · semantic views · staging · rerunnable scripts
All 18 chapters are live, grouped into 5 tracks: Foundations, Joins & Logic, Change & Debug, Analytics & Applied Practice, and Advanced. Work through a track in order, or jump straight to the one you need.