Running Tab
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- L4
Problem
Finance wants to see how each customer's spending accumulates over time. For every row in transactions, compute a per-user running sum of total_amount ordered by transaction_date. Return the user_id, transaction_date, total_amount, and the cumulative spending through that row.
Summary
Every purchase adds to the total. Watch the tab grow.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.