Your question is Top SQL Join and Grouping. Start with the requirements and the two tables 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.
Nomura's internal learning platform stores students and the divisions in which they are enrolled. Write a PostgreSQL query that returns the three highest-scoring students within every division.
students to divisions using division_id.score descending, with student_id ascending as the tie-breaker.| Column | Type | Description |
|---|---|---|
| division_idPK | INTEGER | Unique division identifier |
| division_name | VARCHAR(100) | Nomura division name |
| Column | Type | Description |
|---|---|---|
| student_idPK | INTEGER | Unique student identifier |
| student_name | VARCHAR(100) | Student's name |
| division_id | INTEGER | References divisions.division_id |
| score | INTEGER | Assessment score |