🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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)?

  1. A.ROW_NUMBER needs two columns
  2. B.It makes the query faster
  3. C.Without it, rows with equal salaries can get their numbers in a different order on each run
  4. 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 →