Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Monthly Complaint Trend by Category

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

Your question is Monthly Complaint Trend by Category. 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

You are given complaint records from athenaOne support operations. Write a query to calculate the monthly trend in customer complaints by category, returning one row per complaint category and month with the total number of complaints filed in that month. Use the complaint submission date to derive the month, and sort the results by month and category.

Schema

patient_complaints
ColumnTypeDescription
complaint_idPKINTUnique complaint record ID
customer_idINTCustomer account identifier
complaint_categoryVARCHAR(50)Complaint category
complaint_dateDATEDate the complaint was submitted
complaint_statusVARCHAR(20)Current complaint status
Tablespatient_complaints
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results