Tech_Interview_Prep

Window Functions

Per-row calculations across a related set of rows — running totals, rankings, and row-over-row comparisons — without collapsing rows like GROUP BY does.

Q1.How do window functions differ from `GROUP BY` aggregation?

Q2.What does the `PARTITION BY` clause do in a window function?

Q3.What's the difference between `RANK()` and `DENSE_RANK()` when there's a tie?

Q4.What does `LAG(column, 1)` return for a given row?