Write SQL and Python, run instantly in your browser, and track your progress.
You are a Finance Analyst at Stripe. The Accounts Receivable team needs to track invoice timing by extracting the month and year from issue dates. Parse the invoice dates and extract their month and year components.
| Column Name | Type |
|---|---|
| invoice_id | int64 |
| subscription_id | int64 |
| invoice_number | object |
| issue_date | object |
You are a Finance Analyst at Stripe. The Accounts Receivable team needs to track invoice timing by extracting the month and year from issue dates. Parse the invoice dates and extract their month and year components.
| Column Name | Type |
|---|---|
| invoice_id | int64 |
| subscription_id | int64 |
| invoice_number | object |
| issue_date | object |
| status | object |
| status | object |
| invoice_id | subscription_id | invoice_number | issue_date | status |
|---|---|---|---|---|
| 1 | 1 | INV-2025000001 | 2025-03-26 | paid |
| 2 | 1 | INV-2025000002 | 2025-04-20 | open |
| invoice_id | subscription_id | invoice_number | issue_date | status |
|---|---|---|---|---|
| 1 | 1 | INV-2025000001 | 2025-03-26 | paid |
| 2 | 1 | INV-2025000002 | 2025-04-20 | open |
| invoice_id | invoice_number | issue_date | issue_year | issue_month |
|---|---|---|---|---|
| 1 | INV-2025000001 | 2025-03-26 | 2025 | 3 |
| 2 | INV-2025000002 | 2025-04-20 | 2025 | 4 |
| 3 | INV-2025000003 | 2025-05-23 | 2025 | 5 |
| invoice_id | invoice_number | issue_date | issue_year | issue_month |
|---|---|---|---|---|
| 1 | INV-2025000001 | 2025-03-26 | 2025 | 3 |
| 2 | INV-2025000002 | 2025-04-20 | 2025 | 4 |
| 3 | INV-2025000003 | 2025-05-23 | 2025 | 5 |
Showing first 5 of 99 rows.
Showing first 5 of 99 rows.
1. Data Selection:
2. DateTime Operations:
3. Output:
1. Data Selection:
2. DateTime Operations:
3. Output:
| 3 |
| 3 |
| 1 |
| 1 |
| INV-2025000003 |
| INV-2025000003 |
| 2025-05-23 |
| 2025-05-23 |
| paid |
| paid |
| 4 | 2 | INV-2025000004 | 2025-04-24 | past_due |
| 4 | 2 | INV-2025000004 | 2025-04-24 | past_due |
| 5 | 2 | INV-2025000005 | 2025-05-25 | paid |
| 5 | 2 | INV-2025000005 | 2025-05-25 | paid |
| 4 | INV-2025000004 | 2025-04-24 | 2025 | 4 |
| 4 | INV-2025000004 | 2025-04-24 | 2025 | 4 |
| 5 | INV-2025000005 | 2025-05-25 | 2025 | 5 |
| 5 | INV-2025000005 | 2025-05-25 | 2025 | 5 |