Write SQL and Python, run instantly in your browser, and track your progress.
You are a Product Quality Analyst at Amazon. The Product Returns team is conducting an analysis to identify products with excellent quality and customer satisfaction. They want to find products that have been ordered at least once but have never had any return requests. This list will help the team recognize reliable products and potentially feature them in marketing campaigns or recommend them more prominently.
Your task is to identify all product IDs that appear in the order items but have never been returned.
| Column Name | Type |
|---|---|
| order_item_id | INTEGER |
| order_id | INTEGER |
| product_id |
You are a Product Quality Analyst at Amazon. The Product Returns team is conducting an analysis to identify products with excellent quality and customer satisfaction. They want to find products that have been ordered at least once but have never had any return requests. This list will help the team recognize reliable products and potentially feature them in marketing campaigns or recommend them more prominently.
Your task is to identify all product IDs that appear in the order items but have never been returned.
| Column Name | Type |
|---|---|
| order_item_id | INTEGER |
| order_id | INTEGER |
| product_id |
| INTEGER |
| INTEGER |
| quantity | INTEGER |
| quantity | INTEGER |
| unit_price | REAL |
| unit_price | REAL |
| line_subtotal | REAL |
| line_subtotal | REAL |
| tax_amount | REAL |
| tax_amount | REAL |
| discount_amount | REAL |
| discount_amount | REAL |
| fulfillment_status | TEXT |
| fulfillment_status | TEXT |
| return_requested_at | TEXT |
| return_requested_at | TEXT |
| return_reason | TEXT |
| return_reason | TEXT |
| order_item_id | order_id | product_id | quantity | unit_price | line_subtotal | tax_amount | discount_amount | fulfillment_status | return_requested_at | return_reason |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 10 | 1 |
| order_item_id | order_id | product_id | quantity | unit_price | line_subtotal | tax_amount | discount_amount | fulfillment_status | return_requested_at | return_reason |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 10 | 1 |
| product_id |
|---|
| 1 |
| 2 |
| 3 |
| 5 |
| 6 |
| product_id |
|---|
| 1 |
| 2 |
| 3 |
| 5 |
| 6 |
Showing first 5 of 34 rows. Products that were ordered but never returned.
Showing first 5 of 34 rows. Products that were ordered but never returned.
1. Output Columns:
2. Set Operation:
3. Ordering:
1. Output Columns:
2. Set Operation:
3. Ordering:
| 50.96 |
| 50.96 |
| 50.96 |
| 50.96 |
| 4.14 |
| 4.14 |
| 0.0 |
| 0.0 |
| shipped |
| shipped |
| 2 | 2 | 8 | 3 | 200.51 | 601.53 | 53.2 | 0.0 | delivered |
| 2 | 2 | 8 | 3 | 200.51 | 601.53 | 53.2 | 0.0 | delivered |
| 3 | 3 | 44 | 2 | 34.13 | 68.26 | 6.25 | 0.99 | shipped |
| 3 | 3 | 44 | 2 | 34.13 | 68.26 | 6.25 | 0.99 | shipped |
| 4 | 4 | 47 | 1 | 290.99 | 290.99 | 23.29 | 0.0 | shipped |
| 4 | 4 | 47 | 1 | 290.99 | 290.99 | 23.29 | 0.0 | shipped |
| 5 | 5 | 36 | 3 | 189.87 | 569.61 | 46.78 | 79.38 | backordered |
| 5 | 5 | 36 | 3 | 189.87 | 569.61 | 46.78 | 79.38 | backordered |