Skip to main content
HomeSQL

PostgreSQL Summary Stats and Window Functions

4.3+
80 reviews
Intermediate

Learn how to create queries for analytics and data engineering with window functions, the SQL secret weapon!

Start Course for Free
4 hours12 videos44 exercises85,416 learnersTrophyStatement of Accomplishment

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.
Group

Training 2 or more people?

Try DataCamp for Business

Loved by learners at thousands of companies


Course Description

Have you ever wondered how data professionals use SQL to solve real-world business problems, like generating rankings, calculating moving averages and running totals, deduplicating data, or performing time intelligence? If you already know how to select, filter, order, join and group data with SQL, this course is your next step. By the end, you will be writing queries like a pro! You will learn how to create queries for analytics and data engineering with window functions, the SQL secret weapon! Using flights data, you will discover how simple it is to use window functions, and how flexible and efficient they are.
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.
DataCamp for BusinessFor a bespoke solution book a demo.

In the following Tracks

Certification Available

SQL Fundamentals

Go To Track
Certification Available

Associate Data Analyst in SQL

Go To Track
  1. 1

    Introduction to window functions

    Free

    In this chapter, you'll learn what window functions are, and the two basic window function subclauses, ORDER BY and PARTITION BY.

    Play Chapter Now
    Introduction
    50 xp
    Window functions vs GROUP BY
    50 xp
    Numbering rows
    100 xp
    Numbering Olympic games in ascending order
    100 xp
    ORDER BY
    50 xp
    Numbering Olympic games in descending order
    100 xp
    Numbering Olympic athletes by medals earned
    100 xp
    Reigning weightlifting champions
    100 xp
    PARTITION BY
    50 xp
    Reigning champions by gender
    100 xp
    Reigning champions by gender and event
    100 xp
    Row numbers with partitioning
    50 xp
  2. 2

    Fetching, ranking, and paging

    In this chapter, you'll learn three practical applications of window functions: fetching values from different parts of the table, ranking rows according to their values, and binning rows into different tables.

    Play Chapter Now
  3. 4

    Beyond window functions

    In this last chapter, you'll learn some techniques and functions that are useful when used together with window functions.

    Play Chapter Now
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.

In the following Tracks

Certification Available

SQL Fundamentals

Go To Track
Certification Available

Associate Data Analyst in SQL

Go To Track

datasets

Summer olympics dataset

collaborators

Collaborator's avatar
Sumedh Panchadhar
Collaborator's avatar
Mona Khalil
Collaborator's avatar
Marianna Lamnina
Fernando Gonzalez Prada HeadshotFernando Gonzalez Prada

Data Science Consultant

Fernando is a data science professional with over 20 years of experience in databases, data integration, machine learning, and business intelligence. He designs analytics solutions with Microsoft Data Platform technologies and open source products. He has degrees in economics and IT certifications and is studying Business Analytics at Columbia University. Fernando loves teaching data science to beginners and helping experienced professionals who are transitioning to data science.
See More
Michel Semaan HeadshotMichel Semaan

Data Scientist

Michel is a data scientist who's worked at leading Middle-Eastern startups like Bookwitty (e-commerce) and Anghami (music streaming). He loves using open-source technologies like Python, R, and SQL to analyze data, optimize KPIs, and solve problems.
See More

Don’t just take our word for it

*4.3
from 80 reviews
61%
21%
13%
5%
0%
Sort by
  • Karthika M.
    7 days

    Wonderful course and easy to understand and remember the dataset

  • Jose A.
    27 days

    Awesome

  • Tatiana U.
    about 1 month

    I like it.

  • Mona S.
    about 2 months

    Best course in the SQL Fundamentals track so far! I really appreciated Michel going through the time to properly explain what the code was doing, and the multiple choice questions were also very helpful in checking understanding too!

  • Ihar K.
    4 months

    Great course to unterstand window functions from zero level

"Wonderful course and easy to understand and remember the dataset"

Karthika M.

"Awesome"

Jose A.

"I like it."

Tatiana U.

Join over 15 million learners and start PostgreSQL Summary Stats and Window Functions today!

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.