Skip to content
SQL for Data Analysis: Answer Business Questions with PostgreSQL
Text· 6 minMembers-only lesson

LAG, LEAD and buckets

Ranking looks at the position of a row. The next family of window functions looks at the neighbours: the previous month, the next order, the row before. These are the tools for every "compared to last period" question that an…

This lesson is for members only

This lesson belongs to the full course

Buy the course once, keep access with no time limit.

Lessons marked "open access" work without an account.

We measure site traffic (GA4, Mixpanel). If you say yes, Microsoft Clarity also records how the public pages are used (clicks, scrolling) and we tune Meta ads. Nothing is stored on your device before you answer, and your choice sticks for 6 months.