@rennerocha I can highly recommend this site:
SQL window functions are powerful and amazing.
In SQL Server, even the 'traditional' aggregate functions (MIN, MAX, AVG, COUNT) can be used as window functions.
@rennerocha grievances aside, modern SQL does make for a rather nice language for analytical data-wrangling in general