PARTITION BY defines groups; ORDER BY inside OVER defines order within a partition.
Here’s a detailed, balanced long-form review of T-SQL Fundamentals by Itzik Ben-Gan, suitable for Amazon, Goodreads, or a technical blog. itzik ben-gan t-sql fundamentals