SQL: Rank Scores
Medium
SQL — Window Functions
SQL
DENSE_RANK
Rank scores with dense ranking.
Constraints
Write standard SQL (MySQL 8.0 compatible).
Examples
Example 1:
Input: score
3.50
3.65
4.00
3.85
Output:
Example 2:
Input: score
3.50
3.65
4.00
3.85
Output:
Hints
DENSE_RANK window function.
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console