Write a query to identify top-selling categories over a rolling 30-day window at Etsy.
Use February 28, 2025 as the reporting date. Consider completed sales from February 1 through February 28, inclusive, and return the top three categories by units sold.
category_name, total_units_sold, total_revenue, and sales_rank.sales_rank ascending, then category_name ascending.| Column | Type | Description |
|---|---|---|
| category_idPK | INT | Unique Etsy listing category identifier |
| category_name | VARCHAR(100) | Display name of the category |
| category_description | TEXT | Optional category description |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale identifier |
| category_id | INT | Category associated with the sold listing |
| order_date | DATE | Date of the sale |
| quantity | INT | Number of units in the sale |
| gross_amount | NUMERIC(12,2) | Gross sale revenue before adjustments |
| status | VARCHAR(20) | Sale processing status |