Phase 3 · SQL for Data Analysis
TopicsGROUP BY & HAVING
Part of the Data Analyst Roadmap.
Summary
GROUP BY buckets rows into categories before aggregating (e.g. sales per region), and HAVING filters those aggregated results — the SQL equivalent of a PivotTable.
How to Learn This
- 1Write a query showing total sales grouped by region and month.
- 2Practice using HAVING to filter groups (e.g. only regions with sales over a threshold).
- 3Learn why WHERE can't filter on an aggregated value, but HAVING can.
More topics in SQL for Data Analysis
Stuck on this topic? Ask an Insider
Get 1:1 guidance from people who've walked this exact path — free on the InsideEdge app.