Summarize complex groups with advanced SQL aggregation
8 steps · about 2 h 17 min · Intermediate
- Recheck the aggregate query pipeline (article, DuckDB documentation, 12 min)
Ground the advanced forms in grouping, ordering and null semantics.
- Choose aggregates deliberately (reference, SQLite documentation, 18 min)
Check filtering, ordering and return behaviour before composing a report.
- Filter and combine aggregates (article, Neon PostgreSQL tutorial, 18 min)
Build conditional summaries without duplicating whole queries.
- Generate several grouping levels (reference, EDB, 24 min)
Learn the semantics of GROUPING SETS, ROLLUP and CUBE through worked queries.
- Label subtotal rows safely (reference, Google Cloud documentation, 12 min)
Use GROUPING metadata to distinguish a rolled-up dimension from an ordinary null value.
- Practice the same idea in DuckDB (article, DuckDB documentation, 18 min)
Reinforce the standard syntax on a small local analytical dataset.
- Replace conditional aggregation with FILTER (article, Modern SQL, 15 min)
Compare portable conditional expressions with the clearer standard FILTER clause.
- Design a compact multidimensional report (article, SQL Tutorial, 20 min)
Put the features together and verify that each base fact contributes once per intended grouping level.