Your question is Find Top 3 Regions by Sales. 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.
Write a query to find the top 3 performing regions by sales volume.
Use the provided regions and sales tables. Treat sales volume as the number of rows with a sale_status of completed; exclude sales that do not map to a named region.
region_name and sales_volume| Column | Type | Description |
|---|---|---|
| region_idPK | INTEGER | Unique identifier for a region |
| region_name | VARCHAR(50) | Display name of the region |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INTEGER | Unique identifier for a sale |
| region_id | INTEGER | Region associated with the sale |
| sale_status | VARCHAR(20) | Current status of the sale |
| sale_date | DATE | Date on which the sale was recorded |