Keep SQLtest alive: Help cover this month's $100 server costs to keep all lessons and the SQL playground online. Support the project →
SQL code copied to buffer
Task 6:

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