Your question is Top Three Selling Products SQL. Start with the requirements and the three tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
DICK'S Sporting Goods wants a regional sales view to identify the best-selling products across its store regions. Product rankings should be based on completed sales during calendar year 2025.
Write a PostgreSQL query that returns the top three products by total units sold for each region.
sale_status = 'completed' and sale dates in 2025.| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique regional identifier |
| region_name | VARCHAR(50) | DICK'S Sporting Goods sales region name |
| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique product identifier |
| product_name | VARCHAR(100) | Product display name |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale record identifier |
| region_id | INT | Region associated with the sale |
| product_id | INT | Product associated with the sale |
| units_sold | INT | Number of units sold |
| sale_status | VARCHAR(20) | Transaction status |
| sale_date | DATE | Transaction date |