Write SQL and Python, run instantly in your browser, and track your progress.
As a Category Manager at Amazon, you're tasked with creating a "Premium Collection" showcase for the upcoming Black Friday sales event. The marketing team needs to highlight high-value products that represent the best of what Amazon offers across all categories.
Your task is to identify premium products from the current active catalog that meet specific criteria for inclusion in this premium showcase. You need to generate a list that includes each product's unique identifier, name, category (which serves as the merchandising segment), and price.
The business defines "premium" as products priced at $150 or higher, and only currently active (sellable) products should be considered. To ensure the most expensive items are featured most prominently in the showcase, the list must be sorted by price from highest to lowest. If multiple products share the same price, they should be ordered by product ID in ascending order to maintain consistent results.
| Column Name | Type |
|---|---|
| product_id | INTEGER |
As a Category Manager at Amazon, you're tasked with creating a "Premium Collection" showcase for the upcoming Black Friday sales event. The marketing team needs to highlight high-value products that represent the best of what Amazon offers across all categories.
Your task is to identify premium products from the current active catalog that meet specific criteria for inclusion in this premium showcase. You need to generate a list that includes each product's unique identifier, name, category (which serves as the merchandising segment), and price.
The business defines "premium" as products priced at $150 or higher, and only currently active (sellable) products should be considered. To ensure the most expensive items are featured most prominently in the showcase, the list must be sorted by price from highest to lowest. If multiple products share the same price, they should be ordered by product ID in ascending order to maintain consistent results.
| Column Name | Type |
|---|---|
| product_id | INTEGER |
| sku |
| sku |
| TEXT |
| TEXT |
| product_name | TEXT |
| product_name | TEXT |
| category | TEXT |
| category | TEXT |
| price | REAL |
| price | REAL |
| currency | TEXT |
| currency | TEXT |
| is_active | INTEGER |
| is_active | INTEGER |
| weight_kg | REAL |
| weight_kg | REAL |
| created_at | TEXT |
| created_at | TEXT |
| product_id | sku | product_name | category | price | currency | is_active | weight_kg | created_at |
|---|---|---|---|---|---|---|---|---|
| 1 | SKU-10001 | Casper Original Mattress Queen | Home | 1095.0 | USD |
| product_id | sku | product_name | category | price | currency | is_active | weight_kg | created_at |
|---|---|---|---|---|---|---|---|---|
| 1 | SKU-10001 | Casper Original Mattress Queen | Home | 1095.0 | USD |
| product_id | product_name | category | price |
|---|---|---|---|
| 1 | Casper Original Mattress Queen | Home | 1095.0 |
| 44 | All-Clad D3 Stainless 10-Piece Set | Home | 699.99 |
| 38 | Uplift V2 Standing Desk | Office | 599.0 |
| 2 | Dyson Supersonic Hair Dryer | Beauty |
| product_id | product_name | category | price |
|---|---|---|---|
| 1 | Casper Original Mattress Queen | Home | 1095.0 |
| 44 | All-Clad D3 Stainless 10-Piece Set | Home | 699.99 |
| 38 | Uplift V2 Standing Desk | Office | 599.0 |
| 2 | Dyson Supersonic Hair Dryer | Beauty |
Showing first 5 of 21 rows. Premium merchandising items (active products priced $150+) sorted by price descending.
Showing first 5 of 21 rows. Premium merchandising items (active products priced $150+) sorted by price descending.
Your final output should be a result set that meets the following requirements:
1. Filtering:
is_active is 1).price is greater than or equal to 150.2. Columns:
product_idproduct_namecategoryYour final output should be a result set that meets the following requirements:
1. Filtering:
is_active is 1).price is greater than or equal to 150.2. Columns:
product_idproduct_namecategory| 1 |
| 1 |
| 31.75 |
| 31.75 |
| 2025-02-14 10:57:38 |
| 2025-02-14 10:57:38 |
| 2 | SKU-10002 | Dyson Supersonic Hair Dryer | Beauty | 429.99 | USD | 1 | 0.66 | 2025-02-27 07:20:29 |
| 2 | SKU-10002 | Dyson Supersonic Hair Dryer | Beauty | 429.99 | USD | 1 | 0.66 | 2025-02-27 07:20:29 |
| 3 | SKU-10003 | CalDigit TS4 Thunderbolt Dock | Office | 399.99 | USD | 1 | 0.5 | 2024-12-11 00:49:57 |
| 3 | SKU-10003 | CalDigit TS4 Thunderbolt Dock | Office | 399.99 | USD | 1 | 0.5 | 2024-12-11 00:49:57 |
| 4 | SKU-10004 | Under Armour Tech 2.0 T-Shirt | Sports | 25.0 | USD | 1 | 0.15 | 2024-11-22 04:49:00 |
| 4 | SKU-10004 | Under Armour Tech 2.0 T-Shirt | Sports | 25.0 | USD | 1 | 0.15 | 2024-11-22 04:49:00 |
| 5 | SKU-10005 | Staples TRU RED Copy Paper 10-Ream | Office | 54.99 | USD | 1 | 22.68 | 2025-01-10 01:43:59 |
| 5 | SKU-10005 | Staples TRU RED Copy Paper 10-Ream | Office | 54.99 | USD | 1 | 22.68 | 2025-01-10 01:43:59 |
| 429.99 |
| 429.99 |
| 3 | CalDigit TS4 Thunderbolt Dock | Office | 399.99 |
| 3 | CalDigit TS4 Thunderbolt Dock | Office | 399.99 |
priceprice3. Ordering:
3. Ordering:
price in descending order (highest first).product_id in ascending order.price in descending order (highest first).product_id in ascending order.