Your question is Top 3 Records Per Region. Start with the requirements and the two 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.
Lynker Technologies wants to identify the highest-value sales records within each operating region. Write a PostgreSQL query that ranks records independently within each known region and returns the top three.
regions to display the region name.sale_id ascending as the tie-breaker.regions.| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique region identifier |
| region_name | VARCHAR(50) | Display name of the operating region |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sales record identifier |
| region_id | INT | Region associated with the sales record |
| record_label | VARCHAR(100) | Short description of the sales record |
| sales_amount | NUMERIC(12,2) | Sales amount used for ranking |