Your question is Top 3 Products Per Region. Start with the requirements and the four 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.
Abbott's commercial analytics team needs a regional view of its best-selling medical device products. Write a PostgreSQL query for the last completed quarter, defined here as 2025-04-01 through 2025-06-30.
status = 'Completed' during the specified quarter.product_name ascending.| Column | Type | Description |
|---|---|---|
| region_idPK | INTEGER | Unique Abbott sales region identifier |
| region_name | VARCHAR(100) | Sales region name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INTEGER | Unique sales order identifier |
| region_id | INTEGER | Region assigned to the order |
| order_date | DATE | Date the order was placed |
| status | VARCHAR(20) | Order processing status |
| Column | Type | Description |
|---|---|---|
| order_idPK | INTEGER | Related sales order identifier |
| product_idPK | INTEGER | Related medical device product identifier |
| quantity | INTEGER | Number of units sold |
| Column | Type | Description |
|---|---|---|
| product_idPK | INTEGER | Unique product identifier |
| product_name | VARCHAR(150) | Abbott medical device product name |