Write SQL and Python, run instantly in your browser, and track your progress.
You are a Finance Analyst at Netflix. The Revenue team needs a monthly payment summary to forecast future revenue. Group payments by year and month, and calculate the total payment amount for each month.
| Column Name | Type |
|---|---|
| payment_id | int64 |
| user_id | int64 |
| payment_time | object |
| amount | float64 |
You are a Finance Analyst at Netflix. The Revenue team needs a monthly payment summary to forecast future revenue. Group payments by year and month, and calculate the total payment amount for each month.
| Column Name | Type |
|---|---|
| payment_id | int64 |
| user_id | int64 |
| payment_time | object |
| amount | float64 |
| status | object |
| status | object |
| payment_id | user_id | payment_time | amount | status |
|---|---|---|---|---|
| 1 | 58 | 2025-08-26 14:30:00 | 19.79 | captured |
| 2 | 41 | 2025-04-15 10:20:00 | 14.39 | captured |
| payment_id | user_id | payment_time | amount | status |
|---|---|---|---|---|
| 1 | 58 | 2025-08-26 14:30:00 | 19.79 | captured |
| 2 | 41 | 2025-04-15 10:20:00 | 14.39 | captured |
| payment_year | payment_month | total_amount |
|---|---|---|
| 2024 | 12 | 32.92 |
| 2025 | 1 | 116.83 |
| 2025 | 2 | 59.06 |
| 2025 | 3 | 130.89 |
| 2025 | 4 | 255.67 |
| payment_year | payment_month | total_amount |
|---|---|---|
| 2024 | 12 | 32.92 |
| 2025 | 1 | 116.83 |
| 2025 | 2 | 59.06 |
| 2025 | 3 | 130.89 |
| 2025 | 4 | 255.67 |
Showing first 5 of 10 rows.
Showing first 5 of 10 rows.
1. Data Selection:
2. DateTime Operations:
3. Output:
1. Data Selection:
2. DateTime Operations:
3. Output:
| 3 |
| 3 |
| 44 |
| 44 |
| 2025-07-03 09:15:00 |
| 2025-07-03 09:15:00 |
| 10.39 |
| 10.39 |
| captured |
| captured |
| 4 | 2 | 2025-03-28 16:45:00 | 12.99 | captured |
| 4 | 2 | 2025-03-28 16:45:00 | 12.99 | captured |
| 5 | 55 | 2025-08-10 11:30:00 | 17.99 | captured |
| 5 | 55 | 2025-08-10 11:30:00 | 17.99 | captured |
| 6 | 13 | 2025-07-20 08:00:00 | 9.09 | captured |
| 6 | 13 | 2025-07-20 08:00:00 | 9.09 | captured |