One level at a time
-- Total revenue per regionSELECT region, SUM(revenue) AS total_revenueFROM salesGROUP BY region; -- Total revenue per region and productSELECT region, product, SUM(revenue) AS total_revenueFROM salesGROUP BY region, product;- Result: North 2000, South 2700
- subtotals and a grand total would need extra queries