Explain SQL window functions with examples: ranking employees by salary and comparing current and previous rows
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Asks what SQL window functions are and how analysts use them, such as ranking employees by salary within a department or comparing each row with the previous one. It tests the OVER clause, how ranking functions treat ties, LAG and running totals, and how to filter on a window result.