Your question is Pivot Driver Support Ticket Status. Start with the requirements and the one table 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.
Lyft's operations team often recreates Excel-style pivot tables to monitor support workload. Write a SQL query to summarize the number of driver support tickets by queue, with separate counts for each ticket status.
queue_name.open, resolved, and escalated using conditional aggregation.queue_name is NULL.open_tickets descending, then queue_name ascending.| Column | Type | Description |
|---|---|---|
| ticket_idPK | INT | Unique ticket identifier |
| queue_name | VARCHAR(100) | Lyft support queue handling the ticket |
| ticket_status | VARCHAR(20) | Current ticket status |
| city | VARCHAR(100) | City associated with the ticket |
| created_date | DATE | Date the ticket was created |