SQL for Data Interviews
Querying, aggregation, and joins the way interviews actually ask them.
Chapters
Chapter 1
- Selecting columns (6 min)
- Filtering rows with WHERE (7 min)
- Sorting and limiting results (6 min)
- NULL and three-valued logic (7 min)
- Chapter 1 quiz (5 questions)
Chapter 2
- Grouping and counting rows (8 min)
- Filtering groups with HAVING (8 min)
- Sums, averages, and extremes (8 min)
- Conditional aggregation (8 min)
- Chapter 2 quiz (5 questions)
Chapter 3
- Join keys and inner joins (8 min)
- Outer joins and missing rows (8 min)
- Join fan-out and duplicate control (8 min)
- Joining pre-aggregated results (9 min)
- Chapter 3 quiz (5 questions)
Chapter 4
- Window functions and running totals (10 min)
- Ranking and top-N per group (9 min)
- Lag, lead, and period comparisons (9 min)
- Gaps, islands, and completeness (10 min)
- Chapter 4 quiz (5 questions)