Write a query using window functions to rank students by their test scores within each school district at The College Board.
Use the provided student, district, and test score data. Include only students associated with a district and a non-null test score. Students with equal scores should share the same rank.
student_id, student_name, district_name, test_score, and district_rank.district_name, district_rank, then student_id.| Column | Type | Description |
|---|---|---|
| district_idPK | INT | Unique school district identifier |
| district_name | VARCHAR(100) | School district name |
| Column | Type | Description |
|---|---|---|
| student_idPK | INT | Unique student identifier |
| student_name | VARCHAR(100) | Student's display name |
| district_id | INT | Assigned school district identifier |
| Column | Type | Description |
|---|---|---|
| score_idPK | INT | Unique test score record identifier |
| student_id | INT | Student who received the score |
| test_score | INT | Student's test score |