Write SQL and Python, run instantly in your browser, and track your progress.
You are a Business Analyst at Amazon. The Customer Service team needs a report showing order details along with customer names. Merge the orders DataFrame with the customers DataFrame to get customer information for each order.
| Column Name | Type |
|---|---|
| order_id | int64 |
| order_number | object |
| customer_id | int64 |
| order_datetime | object |
You are a Business Analyst at Amazon. The Customer Service team needs a report showing order details along with customer names. Merge the orders DataFrame with the customers DataFrame to get customer information for each order.
| Column Name | Type |
|---|---|
| order_id | int64 |
| order_number | object |
| customer_id | int64 |
| order_datetime | object |
| status | object |
| status | object |
| total_amount | float64 |
| total_amount | float64 |
| payment_status | object |
| payment_status | object |
| Column Name | Type |
|---|---|
| customer_id | int64 |
| full_name | object |
| object | |
| phone | object |
| city | object |
| state | object |
| Column Name | Type |
|---|---|
| customer_id | int64 |
| full_name | object |
| object | |
| phone | object |
| city | object |
| state | object |
| order_id | order_number | customer_id | order_datetime | status | total_amount | payment_status |
|---|---|---|---|---|---|---|
| 1 | ORD-10001 | 46 | 2025-08-20 07:01:34 | shipped | 55.32 | captured |
| 2 |
| order_id | order_number | customer_id | order_datetime | status | total_amount | payment_status |
|---|---|---|---|---|---|---|
| 1 | ORD-10001 | 46 | 2025-08-20 07:01:34 | shipped | 55.32 | captured |
| 2 |
| customer_id | full_name | phone | city | state | country | created_at | |
|---|---|---|---|---|---|---|---|
| 1 | Sophia Lewis | sophia.lewis@gmail.com | San Diego | CA | US | 2024-10-10 19:19:27 |
| customer_id | full_name | phone | city | state | country | created_at | |
|---|---|---|---|---|---|---|---|
| 1 | Sophia Lewis | sophia.lewis@gmail.com | San Diego | CA | US | 2024-10-10 19:19:27 |
| order_id | customer_id | full_name | total_amount |
|---|---|---|---|
| 1 | 46 | Albert Nakamura | 55.32 |
| 2 | 19 | Vikram Zhang | 662.48 |
| 3 | 21 | Helen Perry | 88.66 |
| 4 | 8 | Patrick Turner | 322.87 |
| order_id | customer_id | full_name | total_amount |
|---|---|---|---|
| 1 | 46 | Albert Nakamura | 55.32 |
| 2 | 19 | Vikram Zhang | 662.48 |
| 3 | 21 | Helen Perry | 88.66 |
| 4 | 8 | Patrick Turner | 322.87 |
Showing first 5 of 75 rows.
Showing first 5 of 75 rows.
1. DataFrames:
2. Merge:
3. Output:
1. DataFrames:
2. Merge:
3. Output:
| country | object |
| country | object |
| created_at | object |
| created_at | object |
| ORD-10002 |
| ORD-10002 |
| 19 |
| 19 |
| 2025-02-24 04:56:03 |
| 2025-02-24 04:56:03 |
| delivered |
| delivered |
| 662.48 |
| 662.48 |
| partial_refund |
| partial_refund |
| 3 | ORD-10003 | 21 | 2025-02-13 17:43:43 | shipped | 88.66 | captured |
| 3 | ORD-10003 | 21 | 2025-02-13 17:43:43 | shipped | 88.66 | captured |
| 19 | Vikram Zhang | vikram.zhang@proton.me | Houston | TX | US | 2025-08-26 22:53:54 |
| 19 | Vikram Zhang | vikram.zhang@proton.me | Houston | TX | US | 2025-08-26 22:53:54 |
| 21 | Helen Perry | helen.perry@proton.me | +1-555-123-4567 | Seattle | WA | US | 2024-11-15 10:30:00 |
| 21 | Helen Perry | helen.perry@proton.me | +1-555-123-4567 | Seattle | WA | US | 2024-11-15 10:30:00 |
| 5 | 8 | Patrick Turner | 629.34 |
| 5 | 8 | Patrick Turner | 629.34 |