Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Top Accounts by Support Ticket Volume

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

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 need to log in / sign up to run or submit.

Problem

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.

Schema

accounts
ColumnTypeDescription
account_idPKINTPrimary key for each account
account_nameVARCHAR(255)Account display name
customer_segmentVARCHAR(100)Customer segment classification
tickets
ColumnTypeDescription
ticket_idPKINTPrimary key for each support ticket
account_idINTReferences the owning account
created_atTIMESTAMPTicket creation timestamp
statusVARCHAR(50)Current ticket status
priorityVARCHAR(20)Ticket priority level
Tablesaccountstickets
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results