← Quiz: Window Functions: all 10 questions
Quiz: Window Functions · Question 10 of 10
Why add a tie-breaker such as name to ROWNUMBER() OVER (ORDER BY salary DESC, name)?
Why add a tie-breaker such as name to ROW_NUMBER() OVER (ORDER BY salary DESC, name)?
- A.ROW_NUMBER needs two columns
- B.It makes the query faster
- C.Without it, rows with equal salaries can get their numbers in a different order on each run
- D.It turns ROW_NUMBER into DENSE_RANK
Answer & explanation
Correct answer: Without it, rows with equal salaries can get their numbers in a different order on each run
ROW_NUMBER must give unique numbers, so ties are broken arbitrarily unless you decide how.
Can you get the rest right without peeking?
Take the timed Quiz: Window Functions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →