Cumulative Revenue within Each Country

medium
Unit 17 · Window Functions X0/2 to milestone

Return each order's country, order_date, total and country_running: the running total of revenue within that country (by date, ties by order id). Sort by country, then order_date, then order id.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#window-functions#running-aggregates1 visible + 1 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Cumulative Revenue within Each Country · TechGradify