SQL Playground
TutorialsPlayground
SQL FormatterSQL MinifierSyntax ValidatorJSON to SQLCSV to SQLSQL to JSONER Diagram Generator
Daily ChallengeInterviewsCheat SheetBlog

© 2026 SQL Playground. Built for developers.

PrivacyTermsAboutRSS Feed
SQL Playground
TutorialsPlayground
SQL FormatterSQL MinifierSyntax ValidatorJSON to SQLCSV to SQLSQL to JSONER Diagram Generator
Daily ChallengeInterviewsCheat SheetBlog
Initializing...
Chapter 6: Window Functions
6-1
Your Progress

Window Functions: RANK()

Window functions perform calculations across a set of table rows that are somehow related to the current row.

Unlike GROUP BY, window functions do not collapse rows into a single output row.

SELECT name, score, RANK() OVER (ORDER BY score DESC) as rank
FROM players;

Task: Rank the employees by their salary in descending order.

Loading...
Run a query to see results