The finance team is putting together their monthly revenue chart. Using the orders table, calculate the total revenue for each calendar month — return year, month, and total revenue, ordered chronologically.
orders
| column | type |
|---|---|
| id | INTEGER |
| customer_id | INTEGER |
| amount | NUMERIC |
| created_at | DATE |
| id | customer_id | amount | created_at |
|---|---|---|---|
| 1 | 1 | 120.00 | 2024-01-05 |
| 2 | 2 | 45.00 | 2024-01-18 |
| 3 | 1 | 300.00 | 2024-02-03 |
| 4 | 3 | 75.50 | 2024-02-20 |
| 5 | 2 | 200.00 | 2024-03-11 |
| 6 | 1 | 50.00 | 2024-03-25 |
| 7 | 4 | 180.00 | 2024-03-30 |
| year | month | revenue |
|---|---|---|
| 2024 | 1 | 165.00 |
| 2024 | 2 | 375.50 |
| 2024 | 3 | 430.00 |
January sums orders 1 and 2 (120 + 45 = 165). February sums orders 3 and 4 (300 + 75.50 = 375.50). March sums orders 5, 6, and 7 (200 + 50 + 180 = 430).