What You'll Learn
Write window functions with OVER() and PARTITION BY
Rank rows with ROW_NUMBER, RANK, DENSE_RANK
Calculate running totals and moving averages
Compare rows across time with LAG and LEAD
Course Syllabus
6 lessons · ~220 minutes01
Intro to Window Functions
25 min
Concept
02
OVER() and PARTITION BY
35 min
Code-Along
03
ROW_NUMBER, RANK, DENSE_RANK
35 min
Code-Along
04
Running Totals & Moving Averages
35 min
Code-Along
05
LAG & LEAD for Time Comparisons
35 min
Code-Along
06
Project: Sales Trend Analysis
55 min
Project
Prerequisites
- SQL Foundations: Subqueries & CTEs
Tools Used
PostgreSQLBrowser SQL Editor