Write SQL and Python, run instantly in your browser, and track your progress.
You are a Data Analyst at Walmart. The Inventory team needs to see order line items with product names for a fulfillment report. Merge the order_items DataFrame with the products DataFrame to get product details for each order item.
| Column Name | Type |
|---|---|
| order_item_id | int64 |
| order_id | int64 |
| product_id | int64 |
| quantity | int64 |
You are a Data Analyst at Walmart. The Inventory team needs to see order line items with product names for a fulfillment report. Merge the order_items DataFrame with the products DataFrame to get product details for each order item.
| Column Name | Type |
|---|---|
| order_item_id | int64 |
| order_id | int64 |
| product_id | int64 |
| quantity | int64 |
| unit_price | float64 |
| unit_price | float64 |
| line_subtotal | float64 |
| line_subtotal | float64 |
| Column Name | Type |
|---|---|
| product_id | int64 |
| product_name | object |
| category | object |
| price | float64 |
| stock | int64 |
| Column Name | Type |
|---|---|
| product_id | int64 |
| product_name | object |
| category | object |
| price | float64 |
| stock | int64 |
| order_item_id | order_id | product_id | quantity | unit_price | line_subtotal |
|---|---|---|---|---|---|
| 1 | 1 | 15 | 2 | 29.99 | 59.98 |
| 2 | 1 | 8 | 1 |
| order_item_id | order_id | product_id | quantity | unit_price | line_subtotal |
|---|---|---|---|---|---|
| 1 | 1 | 15 | 2 | 29.99 | 59.98 |
| 2 | 1 | 8 | 1 |
| product_id | product_name | category | price | stock |
|---|---|---|---|---|
| 3 | Wireless Mouse | Electronics | 12.50 | 150 |
| 8 | Bluetooth Speaker | Electronics | 149.99 | 45 |
| product_id | product_name | category | price | stock |
|---|---|---|---|---|
| 3 | Wireless Mouse | Electronics | 12.50 | 150 |
| 8 | Bluetooth Speaker | Electronics | 149.99 | 45 |
| order_item_id | order_id | product_name | quantity | line_subtotal |
|---|---|---|---|---|
| 1 | 1 | Xbox Wireless Controller | 1 | 50.96 |
| 2 | 2 | Hyperice Hypervolt 2 Pro | 3 | 601.53 |
| 3 | 3 | All-Clad D3 Stainless 10-Piece Set | 2 | 68.26 |
| order_item_id | order_id | product_name | quantity | line_subtotal |
|---|---|---|---|---|
| 1 | 1 | Xbox Wireless Controller | 1 | 50.96 |
| 2 | 2 | Hyperice Hypervolt 2 Pro | 3 | 601.53 |
| 3 | 3 | All-Clad D3 Stainless 10-Piece Set | 2 | 68.26 |
Showing first 5 of 123 rows.
Showing first 5 of 123 rows.
1. DataFrames:
2. Merge:
3. Output:
1. DataFrames:
2. Merge:
3. Output:
| 149.99 |
| 149.99 |
| 149.99 |
| 149.99 |
| 3 | 2 | 3 | 3 | 12.50 | 37.50 |
| 3 | 2 | 3 | 3 | 12.50 | 37.50 |
| 15 |
| 15 |
| Running Shoes |
| Running Shoes |
| Sports |
| Sports |
| 29.99 |
| 29.99 |
| 80 |
| 80 |
| 4 | 4 | Paula's Choice 2% BHA Exfoliant | 1 | 290.99 |
| 4 | 4 | Paula's Choice 2% BHA Exfoliant | 1 | 290.99 |
| 5 | 5 | Ring Video Doorbell Pro 2 | 3 | 569.61 |
| 5 | 5 | Ring Video Doorbell Pro 2 | 3 | 569.61 |