Your goal: compute the right metric at the right grain, and keep it
honest when NULLs and empty groups show up.
How it works (about 20 minutes)
- Maya's live board shows the orders table and an example query for each step.
- You type your own query in the board's editor, then tap Run.
- Maya checks it; the board marks your rows right, missing or extra, and plays how the groups form once it is right.
- A few quick checks cover the classic traps: tap your answer.
What you will practice
- COUNT, COUNT(DISTINCT), SUM, AVG, MIN, MAX and NULLs
- GROUP BY
- HAVING vs WHERE
- CASE WHEN
- Conditional aggregation
- NULL-safe rates
- DATE_TRUNC and days between dates
Tips
- SQL is Postgres-style. MySQL or SQL Server habits are fine; Maya will
mention the difference.
- Style does not matter. Returning the right numbers does.
- Say "hint", "repeat", "skip" or "next" any time.
- Read the SQL Aggregations notes first if you have not.