How can window functions, specifically ROW_NUMBER(), be used for deduplication in SQL?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks how to deduplicate rows in SQL with the ROW_NUMBER() window function, both when selecting one row per duplicate group and when deleting the extra copies from a table. Tests window function semantics, deterministic tie-breaking, NULL handling, and engine differences when deleting duplicates.