From the course: SQL for Statistics Essential Training

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Discrete percentiles

Discrete percentiles - PostgreSQL Tutorial

From the course: SQL for Statistics Essential Training

Start my 1-month free trial

Discrete percentiles

- [Instructor] Starting in pgAdmin, let's list several rows to see the structure of our example data and quickly review it. So I'm going to enter SELECT * FROM store_sales LIMIT 5. And just as a quick review, we have sales date, which is of the date datatype, a day of year, which is an integer from one to 365, a month of year, which is an integer from one to 12, the employee shifts, which is an integer representing the number of employees working in a particular shift. The units sold, which is a count of the number of items sold. And for simplicity, we're not distinguishing between products. And finally we have the revenue, which is a dollar value of the units sold. Now let's sort the stored data by revenue, to see what our top selling days were. So I'm just going to clear this SELECT statement and start with another. And I'm going to SELECT * FROM store_sales and we'll order by revenue. I want the top values at the beginning, so I'm going to order in descending order. We can see that…

Contents