Special offers now — see discounted courses.
day
:
hour
:
min
:
sec
See special offers
PostgreSQL: Advanced Queries

PostgreSQL: Advanced Queries

2h 58mAdvanced2023-11-15

Authors

Adam Wilbert

Adam Wilbert

Data Visualization Expert

Course details

In this course, database expert Adam Wilbert introduces you to a number of advanced query techniques that you can use to better understand your data. Statistical analyses involve understanding the shape and size of the full data set, and deeper insights can be gained by grouping data together to obtain some very useful metrics. Adam shows you how to create basic groups and apply aggregate calculations, then moves into window functions that create subgroups for more granular analysis. He goes over statistics that are based on sorted data within groups, such as the median value, the first and third quartiles of a dataset, the most frequent value, and more. Adam also covers ranking, hypothetical sets, percentile functions, and conditional expressions for further manipulating query result sets. He concludes with some additional querying techniques that you may find useful in solving common problems.

Skills covered

PostgreSQLDesktop DatabasesDatabase DevelopmentDatabase ManagementBusiness Software and ToolsOpen SourceSoftware DevelopmentDeep Dive (X:Y)

Concepts

0. Introduction

  • 01 - Gain additional insights from your PostgreSQL data
  • 02 - What you should know
  • 03 - Using the exercise files

1. Obtain Summary Statistics by Grouping Rows

  • 04 - Using GROUP BY to aggregate data rows
  • 05 - Obtain general-purpose aggregate statistics
  • 06 - Evaluate columns with Boolean aggregates
  • 07 - Find the standard deviation and variance of a dataset
  • 08 - Include overall aggregates with ROLLUP
  • 09 - Return all possible combinations of groups with CUBE
  • 10 - Segmenting groups with aggregate filters
  • 11 - Challenge - Group statistics
  • 12 - Solution - Group statistics

2. Use Window Functions to Perform Calculations across Row Sets

  • 13 - Create a window function with an OVER clause
  • 14 - Partition rows within a window
  • 15 - Streamline partition queries with a WINDOW clause
  • 16 - Ordering data within a partition
  • 17 - Calculate a moving average with a sliding window
  • 18 - Return values at specific locations within a window
  • 19 - Challenge - Leverage window functions
  • 20 - Solution - Leverage window functions

3. Statistics Based on Sorted Data within Groups

  • 21 - Calculate the median value of a dataset
  • 22 - Calculate the first and third quartiles of a dataset
  • 23 - Find the most frequent value within a dataset with MODE
  • 24 - Determine the range of values within a dataset
  • 25 - Challenge - Retrieve statistics of a dataset with groups
  • 26 - Solution - Retrieve statistics of a dataset with groups

4. Ranking Data with Windows and Hypothetical Sets

  • 27 - Rank rows with a window function
  • 28 - Find a hypothetical rank
  • 29 - View top performers with percentile ranks
  • 30 - Evaluate probability with cumulative distribution
  • 31 - Challenge - Evaluate rankings within a dataset
  • 32 - Solution - Evaluate rankings within a dataset

5. Define Output Values with Conditional Expressions

  • 33 - Define values with CASE statements
  • 34 - Merge columns with COALESCE
  • 35 - Convert values to null with NULLIF

6. Additional Querying Techniques for Common Problems

  • 36 - Output row numbers with query results
  • 37 - Cast values to a different data type
  • 38 - Move rows within a result with LEAD and LAG
  • 39 - Use an IN function with a subquery
  • 40 - Define WHERE criteria with a series
  • 41 - Challenge - Calculations across rows
  • 42 - Solution - Calculations across rows
  • 43 - Pattern matching with regular expressions

Conclusion

  • 44 - Next steps

About us

LyndaKade is a leading learning platform that helps people learn business, software, technology, and creative skills to achieve personal and professional goals.

Phone numberAparat ChannelTelegram SupportTelegram ChannelInstagram Page

All rights to this site belong to LyndaKade.

Terms of Service|Privacy Policy

نماد الکترونیک enamad در صورت اتصال با آی‌پی داخل کشور، نمایش داده خواهد شد.
logo-samandehi - لوگو ساماندهی
Zarinpal
Zibal