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 first and third quartiles of a dataset - PostgreSQL Tutorial
From the course: PostgreSQL: Advanced Queries
Calculate the first and third quartiles of a dataset
- [Instructor] The percentile function that we used to calculate the median value of a dataset can be also used to find other division points. For instance, a statistical analysis may require that you split the data into four groups called quartiles. The value where a data point transitions between the first, second, third, and fourth quartiles can be determined using the same percentile functions. Let's take another look at our height data. And because our dataset has an even number of rows, I'm going to be sticking with the continuous percentile functions. So I'll select the percentile_cont, and inside of the parentheses we previously used 0.5 to denote the value 50% of the way through the sorted list of values. But we can put whatever percentage we want in here. To find the break point where a row would transition from the first to second quartile, put 0.25. Then we can finish out the function. Within group we'll order…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Calculate the median value of a dataset6m 25s
-
(Locked)
Calculate the first and third quartiles of a dataset5m 47s
-
(Locked)
Find the most frequent value within a dataset with MODE2m 57s
-
(Locked)
Determine the range of values within a dataset2m 13s
-
(Locked)
Solution: Retrieve statistics of a dataset with groups4m 57s
-
(Locked)
-
-
-
-