Your question is Top Three Products by Region. 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.
Colgate-Palmolive wants a regional view of product performance for the most recently completed calendar quarter. Write a PostgreSQL query that identifies the top-selling products in each sales region.
CURRENT_DATE.regions and products to return readable region and product names.region_name, product_name, total_units_sold, and product_rank.| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique regional identifier |
| region_name | VARCHAR(100) | Sales region name |
| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique product identifier |
| product_name | VARCHAR(150) | Colgate-Palmolive product name |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sales transaction identifier |
| region_id | INT | References regions.region_id |
| product_id | INT | References products.product_id |
| sale_date | DATE | Date on which the sale occurred |
| units_sold | INT | Number of units sold |