🎯 Few days left this month Support SQLTest.online and help us keep SQL practice free for everyone. Donate today →
SQL code copied to buffer
Task 5:

Cumulative Payment Analysis

MySQL
Using the payment table perform a daily cumulative payment analysis for July 2005. For each day of this month, calculate the running count of payments and the running total of amounts recorded up to that date. 
Your final result should include the date, the cumulative payment count (payments_rolling_count), and the cumulative payment amount (payments_rolling_amount) in order of dates.

Task idea by Dmitry Gondyulov

Expected result Columns: 3 · Rows: 31
date payments_rolling_count payments_rolling_amount

Sample rows open after wrong checks: 0 of 3

Write your query below and click "Check it!". Tables are described in the right pane.

Tutorial
The query result will appear here. Ctrl+Enter - Run query