🙏 We need your help! SQLtest.online has no ads and lives only on donations. Even a small amount helps. Donate now →
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

By checking a query, you agree that it is stored without your account details and may be included in anonymized datasets, including for AI training. Learn more

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