Your question is SQL Top Categories 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.
Write a SQL query to find the top three selling product categories by region for the last fiscal quarter.
For this exercise, the last fiscal quarter is April 1, 2026 through June 30, 2026. Use units sold as the sales measure and exclude sales without a valid product category or region.
region, category, units_sold, and category_rank.region, category_rank, then category.| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sales transaction identifier |
| product_id | INT | Product sold in the transaction |
| store_id | INT | Store associated with the transaction |
| sale_date | DATE | Date of the sale |
| quantity | INT | Number of units sold |
| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique product identifier |
| product_name | VARCHAR(100) | Product name |
| category | VARCHAR(60) | Product category |
| Column | Type | Description |
|---|---|---|
| store_idPK | INT | Unique store identifier |
| store_name | VARCHAR(100) | Store name |
| region | VARCHAR(40) | Geographic region assigned to the store |