1SELECT
2 player_id,
3 game_id,
4 score,
5 ROW_NUMBER() OVER (
6 ORDER BY score DESC
7 ) AS game_rank
8FROM scores;
9-- All players get a single global rank instead of rank within each game
no lines flagged
#025PracticeMedium15 min · 120 XP
ROW_NUMBER Wrong PARTITION Breaks Ranking
A leaderboard query ranks players globally instead of per-game, returning wrong rankings. Find the window function fault.
Flagged linesNo lines flagged yet
What's wrong?
Flag a line or write a note to submit.