Aggregation collapses many rows into one summary row per group: GROUP BY names the grouping columns, and SUM, COUNT, AVG, MIN and MAX describe each group. HAVING then filters the groups themselves, which is why it can reference an aggregate while WHERE cannot. This is the largest topic in the question bank because almost every analyst task, from revenue by month to active users per plan, is an aggregation with the right grouping key.
What you will practice
•Know when a column must appear in GROUP BY and why the database rejects it otherwise
•Use WHERE to filter rows before grouping and HAVING to filter groups afterwards
•Understand how COUNT(*), COUNT(column) and COUNT(DISTINCT column) differ on NULLs and duplicates
•Write conditional aggregation with SUM(CASE WHEN ... THEN 1 ELSE 0 END) to pivot a column into metrics
•Combine aggregates with joins without double-counting the fact table