Last Updated: May 12, 2026
For this exercise, we will work with below data:
Write a query that returns each user's username and a running total of their completed payment amount ordered by payment_date. Show username, payment_date, amount, and running_total. Order by user_id, then payment_date.
Write a query that returns the running total of completed payment amount across the whole platform, ordered by payment_date. Show payment_date, the day's daily_revenue, and cumulative_revenue. Order by payment_date.
Write a query that returns the running total of amount per user that resets at the start of each calendar month. Show username, payment_date, month, amount, and month_running (the running total inside the month, per user). Order by user_id, then payment_date.