🎯 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 206:

Monthly and Cumulative Payments

MySQL
Write a request to calculate the amount of payments for each month of 2005 and the cumulative amount from the beginning of the year.
The query should return three columns: payment_month – month of payment (in “YYYY-MM” format), monthly_amount – total amount of payments for month and yearly_amount – amount since the beginning of the year
Expected result Columns: 3 · Rows: 4
payment_month monthly_amount yearly_amount

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