Multi-level aggregations come up often in analytics work: for example, calculating daily totals first and then rolling those up into monthly or regional summaries. Interviewers ask this to test whether you understand how SQL processes grouped data and how to structure queries cleanly.
Explain how you would handle multi-level aggregations in SQL. Your answer should cover:
GROUP BY is sometimes not enoughThe interviewer expects a practical conceptual explanation, not just a definition. You should describe the idea of aggregating at one level first, then using that result set for a second aggregation, and mention how to choose the correct grain before writing the query.