Your question is SQL: Top Categories by GMV Concentration. 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.
Movate's analytics team wants to identify product categories whose annual GMV is highly concentrated in a short seasonal period.
Write a PostgreSQL query for calendar year 2024 that returns the top five product categories where at least 60% of annual GMV occurs in any two consecutive calendar months.
order_status is not completed.| Column | Type | Description |
|---|---|---|
| category_idPK | INT | Unique product category identifier |
| category_name | VARCHAR(100) | Product category name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| category_id | INT | Product category associated with the order |
| order_date | DATE | Date on which the order was placed |
| gmv | NUMERIC(12,2) | Gross merchandise value for the order |
| order_status | VARCHAR(20) | Order processing status |