Revenue by course in the last month
Skypro's finance team closes the books and wants per-course revenue for the previous full calendar month. Today is fixed at 2024-04-15, so 'last month' = March 2024. Payment price is NUMERIC(15,2), order time is TIMESTAMPTZ in Europe/Moscow.
Sum course revenue across 2024-03-01..2024-03-31 inclusive (Moscow local time). Highest-grossing courses come first.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| revenue | course_id |
|---|---|
| 24000.00 | 11 |
| 6000.00 | 12 |
| 5000.50 | 10 |
Skypro
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inFocus radio
Paused · SomaFM · Fluid