How would you use window functions in SQL to find the top three performing product categories by revenue?
Use all available sales records and calculate revenue at the product-category level.
category_name, total_revenue, and performance_rank.performance_rank ascending, breaking revenue ties alphabetically by category name.| Column | Type | Description |
|---|---|---|
| category_idPK | INT | Unique product category identifier |
| category_name | VARCHAR(100) | Product category name |
| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique product identifier |
| product_name | VARCHAR(150) | Autodesk product name |
| category_id | INT | Product category identifier |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale identifier |
| product_id | INT | Product associated with the sale |
| line_revenue | DECIMAL(12,2) | Revenue generated by the sale |