“The learning paths on Dataquest are incredible. They give you a direction through the learning process – you don’t have to guess what to learn next.”

Otávio Silveira

Data Analyst @ Hortifruti

Course overview

Embark on an exciting journey into the world of SQL Window Functions and amplify your data analysis skills. In this course, you’ll master aggregate, ranking, distribution, and offset window functions to streamline intricate queries and extract valuable information. Best of all, you’ll learn by doing – practice and receive feedback directly in the browser. You’ll apply your expertise to a captivating real-world project, fortify your portfolio, and stand out in the competitive data landscape.

Key skills

  • Set up a frame for window functions
  • Compute running aggregations with aggregate window functions
  • Explore rank window functions
  • Apply distribution window functions
  • Use offset window functions

Course outline

Window Functions in SQL [7 lessons]

An Introduction to Window Functions 1h

Lesson Objectives
  • Describe what window functions are
  • Understand different types of window functions
  • Define a window with the OVER() clause
  • Divide a window into partitions using PARTITION BY clause

Window Function Framing 1h

Lesson Objectives
  • Explain window framing
  • Identify framing key terms
  • Create frames using the ROWS BETWEEN and RANGE BETWEEN clauses
  • Indicate frame bounds using the N PRECEDING and N FOLLOWING terms
  • Understand the difference between the ROWS BETWEEN and RANGE BETWEEN clauses

Window Aggregate Functions 1h

Lesson Objectives
  • Define window aggregate functions
  • Add window aggregate functions to non-aggregate queries
  • Add window aggregate functions to aggregate queries

Ranking Window Functions 1h

Lesson Objectives
  • Explain the purpose and benefits of using ranking window functions in SQL
  • Describe the syntax and parameters of each ranking function
  • Understand the differences between ranking window functions to choose the appropriate ranking function
  • Use ranking window functions to solve complex problems

Offset Window Functions 2h

Lesson Objectives
  • Perform multi-row operations using the LAG() and LEAD() functions
  • Identify the first, last, or nth value within a window using offset window functions
  • Apply offset window functions to solve real-world problems

Distribution Window Functions 1h

Lesson Objectives
  • Apply rank distribution window functions for statistical analysis
  • Utilize inverse distribution functions to determine the value at a particular percentile
  • Implement the WINDOW clause to create concise and manageable queries

Guided Project: SQL Window Functions for Northwind Traders 1h

Lesson Objectives
  • Understand the logic behind window functions and CTEs, and their applications in real-world scenarios
  • Construct SQL queries that use window functions and CTEs to solve complex data analysis tasks
  • Analyze and interpret the results of queries to drive data-informed decisions

Projects in this course

Guided Project: SQL Window Functions for Northwind Traders

For this project, you’ll assume the role of a data analyst at Northwind Traders, using advanced SQL techniques to provide insights that drive strategic business decisions.

The Dataquest guarantee


Dataquest has helped thousands of people start new careers in data. If you put in the work and follow our path, you’ll master data skills and grow your career.


We believe so strongly in our paths that we offer a full satisfaction guarantee. If you complete a career path on Dataquest and aren’t satisfied with your outcome, we’ll give you a refund.

Master skills faster with Dataquest

Go from zero to job-ready

Go from zero to job-ready

Learn exactly what you need to achieve your goal. Don’t waste time on unrelated lessons.

Build your project portfolio

Build your project portfolio

Build confidence with our in-depth projects, and show off your data skills.

Challenge yourself with exercises

Challenge yourself with exercises

Work with real data from day one with interactive lessons and hands-on exercises.

Showcase your path certification

Showcase your path certification

Impress employers by completing a capstone project and certifying it with an expert review.

Grow your career with

of learners recommend
Dataquest for career advancement
Dataquest rating
SwitchUp Best Bootcamps
Average salary boost
for learners who complete a path

Aaron Melton

Business Analyst at Aditi Consulting

“Dataquest starts at the most basic level, so a beginner can understand the concepts. I tried learning to code before, using Codecademy and Coursera. I struggled because I had no background in coding, and I was spending a lot of time Googling. Dataquest helped me actually learn.”


Jessica Ko

Machine Learning Engineer at Twitter

“I liked the interactive environment on Dataquest. The material was clear and well organized. I spent more time practicing then watching videos and it made me want to keep learning.”


Victoria E. Guzik

Associate Data Scientist at Callisto Media

“I really love learning on Dataquest. I looked into a couple of other options and I found that they were much too handhold-y and fill in the blank relative to Dataquest’s method. The projects on Dataquest were key to getting my job. I doubled my income!”

Join 1M+ data learners on


Create a free account


Choose a learning path


Complete exercises and projects


Advance your career

Start learning today