catalog_sales (sale_id, category, subcategory, amount) holds one row per sale.
Build a revenue report (the sum of amount) covering only the categories whose total revenue is at least 1,000. For each such category, show:
- •one row per subcategory;
- •a subtotal row with
subcategory = 'ALL'.
End with a grand total row (category = 'ALL', subcategory = 'ALL') that adds up only the categories in the report — the report has to foot.
Columns: category, subcategory, revenue. Sort by category with the grand total last; within a category, subcategories alphabetically followed by its subtotal row.