Write a SQL query to find the top three best-selling events in each ticket category for the past month on Stubhub, using window functions.
Use February 2025 as the past month and the provided event and ticket sale data. Count tickets sold from completed sales during that month.
category, event_id, event_name, tickets_sold, and category_rank.category, category_rank, then event_id.| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique StubHub event identifier |
| event_name | VARCHAR(150) | Event display name |
| category | VARCHAR(50) | Ticket category for the event |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique ticket sale identifier |
| event_id | INT | Referenced event identifier |
| sale_date | DATE | Date the ticket sale was completed |
| quantity | INT | Number of tickets in the sale |