geo_sales (sale_id, customer_id, region, country, amount) holds one row per sale. Finance wants a single report of revenue (the sum of amount) at three levels:
- •one row per country, with its region;
- •one subtotal row per region, with
country = 'ALL'; - •one grand total row, with
region = 'ALL' and country = 'ALL'.
Order it the way the report is read: regions alphabetically, each region's countries alphabetically followed by that region's subtotal row, and the grand total as the very last row.
Columns: region, country, revenue.