Window functions calculates things like
- cumulative sums,
- moving averages within a specified range of rows,
- a range of values, or
- an interval of time.
Window function can work with: SUM(), AVG(), MAX(), MIN(), COUNT(), VARIANCE(), and STDDEV().
Window function can also work with FIRST_VALUE() and LAST_VALUE(), which return the first and last values in a window.