Subtotals and a Grand Total

medium
Unit 19 · Union0/2 to milestone

SQLite has no ROLLUP, so build one. Return revenue by country and month (YYYY-MM), plus a subtotal row per country (month shown as 'All') and a grand total row (country and month both 'All'), with columns country, month, revenue.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
query.sql · SQLite
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Subtotals and a Grand Total · TechGradify