Write SQL and Python, run instantly in your browser, and track your progress.
You are a Data Analyst at Target. Marketing wants to target high-value customers in California and Texas with a special promotion. Merge orders with customer data and filter to find orders over $200 from customers in CA or TX.
| Column Name | Type |
|---|---|
| order_id | int64 |
| order_number | object |
| customer_id | int64 |
| order_datetime | object |
You are a Data Analyst at Target. Marketing wants to target high-value customers in California and Texas with a special promotion. Merge orders with customer data and filter to find orders over $200 from customers in CA or TX.
| 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 | |
| city | object |
| state | object |
| country | object |
| Column Name | Type |
|---|---|
| customer_id | int64 |
| full_name | object |
| object | |
| city | object |
| state | object |
| country | object |
| order_id | order_number | customer_id | order_datetime | status | total_amount | payment_status |
|---|---|---|---|---|---|---|
| 1 | ORD-001 | 1 | 2025-01-15 | delivered | 350.00 | captured |
| 2 |
| order_id | order_number | customer_id | order_datetime | status | total_amount | payment_status |
|---|---|---|---|---|---|---|
| 1 | ORD-001 | 1 | 2025-01-15 | delivered | 350.00 | captured |
| 2 |
| customer_id | full_name | city | state | country | created_at | |
|---|---|---|---|---|---|---|
| 1 | Alice Johnson | alice@email.com | Los Angeles | CA | US | 2024-06-01 |
| 2 |
| customer_id | full_name | city | state | country | created_at | |
|---|---|---|---|---|---|---|
| 1 | Alice Johnson | alice@email.com | Los Angeles | CA | US | 2024-06-01 |
| 2 |
| order_id | full_name | state | total_amount |
|---|---|---|---|
| 6 | Ahmed Rodriguez | TX | 233.31 |
| 8 | Sophia Lewis | CA | 482.30 |
| 10 | Denise Huang | TX | 251.56 |
| 14 | Ahmed Rodriguez | TX | 705.83 |
| order_id | full_name | state | total_amount |
|---|---|---|---|
| 6 | Ahmed Rodriguez | TX | 233.31 |
| 8 | Sophia Lewis | CA | 482.30 |
| 10 | Denise Huang | TX | 251.56 |
| 14 | Ahmed Rodriguez | TX | 705.83 |
Showing first 5 of 12 rows.
Showing first 5 of 12 rows.
1. DataFrames:
2. Merge:
3. Filter:
4. Output:
1. DataFrames:
2. Merge:
3. Filter:
4. Output:
| created_at | object |
| created_at | object |
| ORD-002 |
| ORD-002 |
| 2 |
| 2 |
| 2025-01-16 |
| 2025-01-16 |
| shipped |
| shipped |
| 150.00 |
| 150.00 |
| captured |
| captured |
| 3 | ORD-003 | 1 | 2025-01-17 | delivered | 275.00 | captured |
| 3 | ORD-003 | 1 | 2025-01-17 | delivered | 275.00 | captured |
| 4 | ORD-004 | 3 | 2025-01-18 | processing | 425.00 | pending |
| 4 | ORD-004 | 3 | 2025-01-18 | processing | 425.00 | pending |
| Bob Smith |
| Bob Smith |
| bob@email.com |
| bob@email.com |
| Austin |
| Austin |
| TX |
| TX |
| US |
| US |
| 2024-07-15 |
| 2024-07-15 |
| 3 | Carol White | carol@email.com | Seattle | WA | US | 2024-08-20 |
| 3 | Carol White | carol@email.com | Seattle | WA | US | 2024-08-20 |
| 19 | Ahmed Rodriguez | TX | 928.38 |
| 19 | Ahmed Rodriguez | TX | 928.38 |