Turning Learners Into Developers
Codekilla
CODEKILLA
Easy
SQL-W01sql

Rank Students By Score

Problem

Given `scores(student, score)`, output (student, score, rnk) using `RANK()` ordered by score desc. Ties share a rank; the next rank skips.

Input
scores table.
Output
student, score, rnk
Constraints
1 ≤ rows ≤ 10^5
Sample input
Ada,90; Linus,90; Grace,85; Ken,70
Sample output
Ada,90,1
Linus,90,1
Grace,85,3
Ken,70,4
Explanation
RANK leaves a gap after ties; DENSE_RANK doesn't.
window-fnrank@Bloomberg
Visible test cases
in: see
out: ...
Your solution — run it, use AI if stuck
sql