Advance Auto Parts wants to identify the strongest-selling automotive parts across store categories. Write a SQL query that calculates total units sold for each part within each store category during the previous complete calendar quarter.
store_category, part_id, part_name, total_units_sold, and sales_rank.part_id.| Column | Type | Description |
|---|---|---|
| store_idPK | INT | Unique store identifier |
| store_name | VARCHAR(100) | Store name |
| store_category | VARCHAR(50) | Business category assigned to the store |
| Column | Type | Description |
|---|---|---|
| part_idPK | INT | Unique automotive part identifier |
| part_name | VARCHAR(150) | Automotive part description |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sales record identifier |
| store_id | INT | Store associated with the sale |
| part_id | INT | Part associated with the sale |
| sale_date | DATE | Date of the sale |
| quantity | INT | Number of units sold |