Write SQL and Python, run instantly in your browser, and track your progress.
You are a Logistics Analyst at Amazon. The Operations team needs to review all orders that have completed the fulfillment process - either already delivered or currently shipped (in transit). Filter the orders DataFrame to find orders that have status 'delivered' OR 'shipped'.
| Column Name | Type |
|---|---|
| order_id | int64 |
| order_number | object |
| customer_id | int64 |
| order_datetime |
You are a Logistics Analyst at Amazon. The Operations team needs to review all orders that have completed the fulfillment process - either already delivered or currently shipped (in transit). Filter the orders DataFrame to find orders that have status 'delivered' OR 'shipped'.
| Column Name | Type |
|---|---|
| order_id | int64 |
| order_number | object |
| customer_id | int64 |
| order_datetime |
| object |
| object |
| status | object |
| status | object |
| total_amount | float64 |
| total_amount | float64 |
| payment_status | object |
| payment_status | 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 |
| order_id | customer_id | status | total_amount |
|---|---|---|---|
| 22 | 48 | shipped | 2733.32 |
| 67 | 43 | delivered | 2034.68 |
| 75 | 50 | delivered | 1646.43 |
| 20 | 46 | shipped | 1201.97 |
| order_id | customer_id | status | total_amount |
|---|---|---|---|
| 22 | 48 | shipped | 2733.32 |
| 67 | 43 | delivered | 2034.68 |
| 75 | 50 | delivered | 1646.43 |
| 20 | 46 | shipped | 1201.97 |
Showing first 5 of 42 rows.
Showing first 5 of 42 rows.
1. Data Selection:
2. Filtering:
3. Output:
1. Data Selection:
2. Filtering:
3. Output:
| 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 |
| 4 | ORD-10004 | 8 | 2025-02-07 13:00:50 | shipped | 322.87 | captured |
| 4 | ORD-10004 | 8 | 2025-02-07 13:00:50 | shipped | 322.87 | captured |
| 5 | ORD-10005 | 8 | 2025-06-24 03:59:58 | packed | 629.34 | captured |
| 5 | ORD-10005 | 8 | 2025-06-24 03:59:58 | packed | 629.34 | captured |
| 25 | 44 | shipped | 1145.30 |
| 25 | 44 | shipped | 1145.30 |