Start here. This is the direct spoken answer to practice first.
Why this question matters
Aggregate questions are common because many backend features need counts, totals, and summaries. The important part is not the syntax alone, but whether the candidate can protect business meaning.
I would use GROUP BY when I need one result row per category, customer, day, status, or other grouping key. WHERE filters rows before aggregation, while HAVING filters groups after aggregation. For example, to find customers with more than five paid orders this month, I would filter paid orders in WHERE, group by customer id, then use HAVING COUNT(*) > 5. That keeps row filtering and group filtering separate.