How would you compute the average score by question using SQL?
Use the questions and responses tables. Include every question, ignore NULL scores when calculating averages, and preserve questions with no scored responses.
question_id, question_text, and average_scorequestion_id ascending| Column | Type | Description |
|---|---|---|
| question_idPK | INT | Unique identifier for the question |
| question_text | VARCHAR(255) | Text displayed for the question |
| Column | Type | Description |
|---|---|---|
| response_idPK | INT | Unique identifier for the response |
| question_id | INT | Question answered by the response |
| respondent_name | VARCHAR(100) | Optional respondent name |
| score | NUMERIC(4,2) | Numeric score assigned to the response |