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 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.
| Column | Type | Description |
|---|---|---|
| feedback_idPK | INT | Unique feedback record identifier |
| customer_id | INT | Customer identifier; may be NULL in invalid records |
| channel | VARCHAR(50) | Feedback source channel |
| feedback_text | TEXT | Free-text feedback message |
| rating | INT | Rating from 1 to 5; invalid rows may contain 0 or negative values |
| submitted_at | DATE | Date the feedback was submitted |