Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Pivot Driver Support Ticket Status

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

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.

You need to log in / sign up to run or submit.

Problem

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.

Requirements

  1. Return one row per queue_name.
  2. Count how many tickets in each queue are open, resolved, and escalated using conditional aggregation.
  3. Exclude rows where queue_name is NULL.
  4. Order the result by open_tickets descending, then queue_name ascending.

Schema

driver_support_tickets
ColumnTypeDescription
ticket_idPKINTUnique ticket identifier
queue_nameVARCHAR(100)Lyft support queue handling the ticket
ticket_statusVARCHAR(20)Current ticket status
cityVARCHAR(100)City associated with the ticket
created_dateDATEDate the ticket was created
Tablesdriver_support_tickets
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results