Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Summarize Customer Support Outcomes

MediumSQL · PostgreSQL00:00
I
Practice interviewer
Your interviewer
In session
I
Interviewer

Welcome to the SQL screen.

The question is on your right: Summarize Customer Support Outcomes. Read through the requirements and the three tables first.

Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?

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

Problem

You are given ACME House customer support and order data and asked to produce a concise dataset summary that could support an analyst’s explanation of a complex analysis. Write a PostgreSQL query that returns one row per customer segment for tickets created in January 2024, showing how many tickets were opened, how many unique customers submitted them, the average resolution time in hours for resolved tickets, and the share of tickets that were tied to an order placed within 30 days before the ticket. Only keep segments with at least 2 tickets, and sort the output by ticket count descending and segment name.

Schema

customers
ColumnTypeDescription
customer_idPKINTUnique customer identifier
customer_nameVARCHAR(100)Customer full name
segmentVARCHAR(50)Customer segment used in ACME House reporting
signup_dateDATEDate the customer signed up
orders
ColumnTypeDescription
order_idPKINTUnique order identifier
customer_idINTCustomer who placed the order
order_dateDATEDate the order was placed
order_totalDECIMAL(10,2)Total order value
support_tickets
ColumnTypeDescription
ticket_idPKINTUnique support ticket identifier
customer_idINTCustomer who opened the ticket
created_atTIMESTAMPTicket creation timestamp
resolved_atTIMESTAMPTicket resolution timestamp
channelVARCHAR(30)Support intake channel
issue_typeVARCHAR(50)Category of support issue
Tablescustomersorderssupport_tickets
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results