Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Rank Customers by Support Incidents

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

Your question is Rank Customers by Support Incidents. 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

Write a PostgreSQL query that ranks active customers by the number of support incidents. Return each active customer's name, total incident count, count of high-severity incidents, most recent incident date, and rank. Customers with the same total incident count should share the same rank.

Schema

ColumnTypeDescription
customer_id
customer_name
account_status
industry
ColumnTypeDescription
incident_id
customer_id
product_name
severity
opened_at
Tablescustomerssupport_incidents
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results