From the course: PostgreSQL: Advanced Queries

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Calculate the median value of a dataset

Calculate the median value of a dataset - PostgreSQL Tutorial

From the course: PostgreSQL: Advanced Queries

Calculate the median value of a dataset

- [Instructor] In statistics, there are multiple ways to evaluate a dataset and determine the average value or what's more specifically called the central tendency. You may know these by the terms mean, median, mode, and range. Each one describes the central value in the set in a slightly different way and each one can be useful in different types of analyses. Now we've already talked about the mean of a dataset. That's the traditional average where you add up all of the values and then divide by the number of data points. PostgreSQL handles this with the AVG function that we've used with groups and window functions. So this chapter is going to focus on the other three measurements of central tendency starting with median. The median of a dataset can be found by sorting all of the numeric values from low to high and then finding the value that occurs at the midpoint of the list. To explore this, let's return to the…

Contents