Your question is Summarize Survey Ratings by Question. 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 customer feedback survey responses collected for Elsevier products such as ScienceDirect and Scopus. Write a SQL query to summarize the survey results for each survey question by returning the question text, the number of non-null ratings submitted, and the average rating. Only include rows where rating_score is not null, and sort the results by average rating descending and then by question text ascending.
| Column | Type | Description |
|---|---|---|
| response_idPK | INT | Unique identifier for each survey response row |
| product_name | VARCHAR(100) | Elsevier product associated with the survey response |
| question_text | VARCHAR(255) | Survey question answered by the customer |
| rating_score | INT | Rating score from 1 to 5; null if the question was skipped |
| submitted_date | DATE | Date the survey response was submitted |