Explain the QUALIFY clause. When and why would you use it in conjunction with window functions?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks what the SQL QUALIFY clause does and when to use it with window functions such as ROW_NUMBER. Tests understanding of query evaluation order, latest-per-group and deduplication patterns, tie handling, and which SQL engines support the clause.