sqlintermediate

SQL Window Function with CTE

DENSE_RANK partition query ranking top typists per language

By ApeType Staff·14 lines·307 characters·1,420 total attempts
SOURCE CODE·sql
WITH RankedSessions AS ( SELECT user_id, language, wpm, accuracy, DENSE_RANK() OVER ( PARTITION BY language ORDER BY wpm DESC, accuracy DESC ) as rank FROM session_metrics sm JOIN practice_sessions ps ON sm.session_id = ps.id ) SELECT * FROM RankedSessions WHERE rank <= 10;
UTF-8 · Tab indentationStandard Strict Parsing
TRANSCRIBE

Ready when you are.

Test your muscle memory and transcription speed against this exact snippet.

Start Typing
Tip: Press Esc anytime to restart

Best runs on this snippet

#TypistAccWPM
1Henok Yoseph100%75
2Henok Yoseph100%75
3Henok Yoseph100%75