Loading...
Rolling Weekly Total
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- senior
Problem
A fraud detection model monitors spending velocity. Return every transaction along with a rolling 7-day spending total for the same user, ordered by transaction date. Include user_id, transaction_date, total_amount, and the rolling sum.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.