Explain how you would structure a relational database schema to support a multi-question, multi-dimension personality assessment.
For this SQL exercise, use the provided assessment, question, response, and answer data model. Write a PostgreSQL query that reports dimension-level scores for assessment 1, excluding respondents without scored answers.
respondent_id, dimension, answered_questions, and average_scorerespondent_id, then dimension| Column | Type | Description |
|---|---|---|
| question_idPK | INT | Unique question identifier |
| assessment_id | INT | Assessment version containing the question |
| dimension | VARCHAR(50) | Personality dimension measured by the question |
| prompt | TEXT | Question text presented to the respondent |
| Column | Type | Description |
|---|---|---|
| response_idPK | INT | Unique assessment response identifier |
| assessment_id | INT | Assessment version being completed |
| respondent_id | INT | Person completing the assessment |
| completed_at | DATE | Date the assessment was completed |
| Column | Type | Description |
|---|---|---|
| answer_idPK | INT | Unique answer identifier |
| response_id | INT | Assessment response containing the answer |
| question_id | INT | Question being answered |
| score | INT | Numeric response score, from 1 to 5 when answered |