SQL interview question: Rank scores without gaps
medium
DENSE_RANK
ORDER BY
Return every score with its rank, highest first. Equal scores share a rank and the next rank has no gap (1, 2, 2, 3). Order by score descending.
Expected columns: score, rank. Column names don't have to match. Runs on SQLite in your browser.
Tables: scores
Your query
Ctrl/Cmd + Enter