Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Clean Customer Feedback Records

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

Your question is Clean Customer Feedback Records. 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 raw customer feedback records from an Orange survey export. Write a PostgreSQL query that returns the number of valid feedback submissions by channel, excluding rows with missing customer_id, blank feedback_text, or non-positive rating. Sort the result by the count descending, then by channel ascending.

Schema

feedback
ColumnTypeDescription
feedback_idPKINTUnique feedback record identifier
customer_idINTCustomer identifier; may be NULL in invalid records
channelVARCHAR(50)Feedback source channel
feedback_textTEXTFree-text feedback message
ratingINTRating from 1 to 5; invalid rows may contain 0 or negative values
submitted_atDATEDate the feedback was submitted
Tablesfeedback
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results