Write SQL and Python, run instantly in your browser, and track your progress.
You are a Data Analyst at Amazon. The Logistics team needs to analyze order patterns by extracting date components from order timestamps. Extract the year, month, and day from each order's datetime for downstream reporting.
| Column Name | Type |
|---|---|
| order_id | int64 |
| order_number | object |
| order_datetime | object |
| status | object |
You are a Data Analyst at Amazon. The Logistics team needs to analyze order patterns by extracting date components from order timestamps. Extract the year, month, and day from each order's datetime for downstream reporting.
| Column Name | Type |
|---|---|
| order_id | int64 |
| order_number | object |
| order_datetime | object |
| status | object |
| total_amount | float64 |
| total_amount | float64 |
| order_id | order_number | order_datetime | status | total_amount |
|---|---|---|---|---|
| 1 | ORD-10001 | 2025-08-20 07:01:34 | shipped | 55.32 |
| 2 | ORD-10002 | 2025-02-24 04:56:03 | delivered | 662.48 |
| order_id | order_number | order_datetime | status | total_amount |
|---|---|---|---|---|
| 1 | ORD-10001 | 2025-08-20 07:01:34 | shipped | 55.32 |
| 2 | ORD-10002 | 2025-02-24 04:56:03 | delivered | 662.48 |
| order_id | order_datetime | order_year | order_month | order_day |
|---|---|---|---|---|
| 1 | 2025-08-20 07:01:34 | 2025 | 8 | 20 |
| 2 | 2025-02-24 04:56:03 | 2025 | 2 | 24 |
| 3 | 2025-02-13 17:43:43 | 2025 | 2 | 13 |
| order_id | order_datetime | order_year | order_month | order_day |
|---|---|---|---|---|
| 1 | 2025-08-20 07:01:34 | 2025 | 8 | 20 |
| 2 | 2025-02-24 04:56:03 | 2025 | 2 | 24 |
| 3 | 2025-02-13 17:43:43 | 2025 | 2 | 13 |
Showing first 5 of 75 rows.
Showing first 5 of 75 rows.
1. Data Selection:
2. DateTime Operations:
3. Output:
1. Data Selection:
2. DateTime Operations:
3. Output:
| 3 | ORD-10003 | 2025-02-13 17:43:43 | shipped | 88.66 |
| 3 | ORD-10003 | 2025-02-13 17:43:43 | shipped | 88.66 |
| 4 | ORD-10004 | 2025-02-07 13:00:50 | shipped | 322.87 |
| 4 | ORD-10004 | 2025-02-07 13:00:50 | shipped | 322.87 |
| 5 | ORD-10005 | 2025-06-24 03:59:58 | packed | 629.34 |
| 5 | ORD-10005 | 2025-06-24 03:59:58 | packed | 629.34 |
| 4 | 2025-02-07 13:00:50 | 2025 | 2 | 7 |
| 4 | 2025-02-07 13:00:50 | 2025 | 2 | 7 |
| 5 | 2025-06-24 03:59:58 | 2025 | 6 | 24 |
| 5 | 2025-06-24 03:59:58 | 2025 | 6 | 24 |