Your question is Top Accounts by Support Ticket Volume. 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.
You are given support ticket data and account metadata. Write a PostgreSQL query that returns the top 10 accounts by support ticket volume in the last 90 days, ranked from highest to lowest ticket count. Use the ticket creation date to define the 90-day window.
| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Primary key for each account |
| account_name | VARCHAR(255) | Account display name |
| customer_segment | VARCHAR(100) | Customer segment classification |
| Column | Type | Description |
|---|---|---|
| ticket_idPK | INT | Primary key for each support ticket |
| account_id | INT | References the owning account |
| created_at | TIMESTAMP | Ticket creation timestamp |
| status | VARCHAR(50) | Current ticket status |
| priority | VARCHAR(20) | Ticket priority level |