Your question is SQL Top Two Scores Per Subject. 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.
Zeta's assessment dashboard needs to display the strongest student results for every subject. Write a PostgreSQL query that returns the top two students in each subject from the students table.
score is NULL.student_id as the deterministic tie-breaker.| Column | Type | Description |
|---|---|---|
| student_idPK | INT | Unique student identifier |
| student_name | VARCHAR(100) | Student's name |
| subject | VARCHAR(50) | Assessment subject |
| score | INT | Assessment score |