Finance is preparing a quarterly earnings report. Using the orders table, calculate total revenue per quarter — return year, quarter (1–4), and revenue, ordered chronologically.
orders
| column | type |
|---|---|
| id | INTEGER |
| customer_id | INTEGER |
| amount | NUMERIC |
| created_at | DATE |
| id | customer_id | amount | created_at |
|---|---|---|---|
| 1 | 1 | 100 | 2024-01-15 |
| 2 | 2 | 200 | 2024-03-20 |
| 3 | 1 | 150 | 2024-05-10 |
| 4 | 3 | 300 | 2024-08-25 |
| 5 | 2 | 250 | 2024-11-01 |
| year | quarter | revenue |
|---|---|---|
| 2024 | 1 | 300 |
| 2024 | 2 | 150 |
| 2024 | 3 | 300 |
| 2024 | 4 | 250 |