Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSQLwindow functions ROW_NUMBER RANKSingle-choice MCQ

Using a named WINDOW clause, both expressions below share one window definition. What does the query return for `r` and `d` when three rows tie on the top salary?

SELECT RANK() OVER w AS r, DENSE_RANK() OVER w AS d FROM emp WINDOW w AS (ORDER BY salary DESC); -- top 3 salaries are all equal, then the 4th-highest follows