Running Total of Order Amounts Per Customer
Hard
joins
Stripe
Airbnb
Netflix
Join customers and orders, then use a window function to compute a running total of order amounts per customer, ordered by order date.
Expected Output
| customer_name | order_date | amount | running_total |
|---|---|---|---|
| Alice | 2024-01-01 | 50.0 | 50.0 |
| Alice | 2024-02-01 | 80.0 | 130.0 |
| Alice | 2024-03-01 | 20.0 | 150.0 |
| Bob | 2024-01-15 | 60.0 | 60.0 |
| Bob | 2024-02-15 | 40.0 | 100.0 |
Tables
Hints (3 available)
SQL Editor
Output
Click "Run" to see results...