Skip to main content
00:00/00:00
Lecture 16 of 43

Create a window function with an OVER clause

Download Course (Free)

Course Content

0 / 43 completed
Section 1: Introduction3 videos

Gain additional insights from your PostgreSQL data

2m

What you should know

1m

Using the exercise files

3m
Section 2: Obtain Summary Statistics by Grouping Rows9 videos

Include overall aggregates with ROLLUP

5m

Obtain general-purpose aggregate statistics

6m

Using GROUP BY to aggregate data rows

8m

Evaluate columns with Boolean aggregates

5m

Return all possible combinations of groups with CUBE

4m

Find the standard deviation and variance of a dataset

6m

Segmenting groups with aggregate filters

6m

Solution Group statistics

9m

Challenge Group statistics

1m
Section 3: Use Window Functions to Perform Calculations across Row Sets8 videos

Streamline partition queries with a WINDOW clause

3m

Ordering data within a partition

6m

Calculate a moving average with a sliding window

5m

Create a window function with an OVER clause

4mNow Playing

Partition rows within a window

5m

Challenge Leverage window functions

1m

Return values at specific locations within a window

9m

Solution Leverage window functions

6m
Section 4: Statistics Based on Sorted Data within Groups6 videos

Calculate the median value of a dataset

7m

Find the most frequent value within a dataset with MODE

3m

Calculate the first and third quartiles of a dataset

7m

Determine the range of values within a dataset

2m

Challenge Retrieve statistics of a dataset with groups

1m

Solution Retrieve statistics of a dataset with groups

7m
Section 5: Ranking Data with Windows and Hypothetical Sets6 videos

Rank rows with a window function

7m

Find a hypothetical rank

5m

View top performers with percentile ranks

6m

Challenge Evaluate rankings within a dataset

1m

Evaluate probability with cumulative distribution

3m

Solution Evaluate rankings within a dataset

7m
Section 6: Define Output Values with Conditional Expressions3 videos

Define values with CASE statements

7m

Merge columns with COALESCE

4m

Convert values to null with NULLIF

3m
Section 7: Additional Querying Techniques for Common Problems7 videos

Cast values to a different data type

2m

Output row numbers with query results

3m

Move rows within a result with LEAD and LAG

7m

Use an IN function with a subquery

5m

Challenge Calculations across rows

1m

Solution Calculations across rows

6m

Define WHERE criteria with a series

5m
Section 8: Conclusion1 videos

Next steps

1m