Running Total per Customer

medium
Unit 10 · Window Functions III0/2 to milestone

For each order, return customer_id, order_date, total and running_total — the cumulative spend of that customer up to and including that order (ordered by order_date).

Sort the output by customer_id, then order_date.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#window-functions1 visible + 1 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Running Total per Customer · TechGradify