Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Analyze Feedback by Channel Segment

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

Your question is Analyze Feedback by Channel Segment. Start with the requirements and the three 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 customer feedback submitted across DISH touchpoints such as the MyDISH app, chat, phone, and web. Write a PostgreSQL query that returns feedback performance by channel, product_name, and region_name for feedback submitted in Q1 2024. For each combination, show the total number of feedback records, average rating rounded to 2 decimals, counts of positive and negative feedback based on rating, and rank the combinations within each channel by lowest average rating so the most problematic segments appear first. Only include groups with at least 2 feedback records.

Schema

feedback
ColumnTypeDescription
feedback_idPKINTUnique feedback record identifier
customer_idINTCustomer who submitted the feedback
product_idINTReferenced product identifier
submitted_atDATEDate the feedback was submitted
channelVARCHAR(50)Feedback channel such as MyDISH App, Chat, Phone, or Web
ratingINTCustomer rating on a 1 to 5 scale
comment_textTEXTOptional free-text feedback comment
products
ColumnTypeDescription
product_idPKINTUnique product identifier
product_nameVARCHAR(100)DISH product or service name
customers
ColumnTypeDescription
customer_idPKINTUnique customer identifier
region_nameVARCHAR(50)Customer region
Tablesfeedbackproductscustomers
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results