Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Monthly Complaint Trend by Category
00:00
5 left

Monthly Complaint Trend by Category

EasySQL · PostgreSQL

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
Interviewer

Your question is Monthly Complaint Trend by Category. Start with the requirements and the one table in the Question tab.

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.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.