Skip to main content

Course

PostgreSQL Summary Stats and Window Functions

Intermediate4 hr

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

Sql4 hr12 videos44 Exercises3,550 XP120K+Statement of accomplishment

Create Your Free Account

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

Loved by learners at thousands of companies

Training a Team?

Try for Business

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.The videos contain live transcripts you can reveal by clicking "Show transcript" at the bottom left of the videos. The course glossary can be found on the right in the resources section. To obtain CPE credits you need to complete the course and reach a score of 70% on the qualified assessment. You can navigate to the assessment by clicking on the CPE credits callout on the right.

Feels like what you want to learn?

Start Course for Free

What you'll learn

  • Assess the use of aggregate window functions with frame clauses to compute running totals, moving averages, and other cumulative statistics
  • Differentiate among core window functions such as ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD, FIRST_VALUE, LAST_VALUE, and NTILE based on their operational behavior and analytic applications
  • Distinguish between ROWS and RANGE frame types and Evaluate their effects on result sets when ordering columns contain duplicate values
  • Identify the essential syntax elements of PostgreSQL window functions, including the OVER clause, ORDER BY, PARTITION BY, and frame definitions
  • Recognize advanced data-reshaping and summarization techniques using CROSSTAB pivoting, ROLLUP, and CUBE to generate multi-level totals in PostgreSQL analyses.

Prerequisites

Curriculum

Course outline

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.
Start Chapter
4

Beyond window functions

S

PostgreSQL Summary Stats and Window Functions

Course
Complete

Earn Statement of Accomplishment

Enroll Now

Grow your data skills with DataCamp for Mobile

Make progress on the go with our mobile courses and daily 5-minute coding challenges.