Why ROW_NUMBER() gives non-deterministic results with ties in ORDER BY, and how to make the ranking consistent
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks why ROW_NUMBER() can return different results across runs when rows tie on the ORDER BY columns, and how to make the ranking repeatable. Tests understanding of SQL ordering guarantees, top-row-per-group deduplication, and the choice between ROW_NUMBER, RANK and DENSE_RANK.