Rollup Totals
Return total sales per region and product, plus a subtotal per region and a grand total (NULL marks the rolled-up level). Use GROUP BY ROLLUP or an equivalent UNION.
Table schema
Sales(region VARCHAR(20), product VARCHAR(20), amount INT)Sample data
region | product | amount
East | Pen | 10
East | Book | 20
West | Pen | 5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.