From the course: PostgreSQL: Advanced Queries
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Evaluate columns with Boolean aggregates - PostgreSQL Tutorial
From the course: PostgreSQL: Advanced Queries
Evaluate columns with Boolean aggregates
- [Instructor] The Boolean data type is used to represent data that is either true or false, on or off, or yes or no. We can take a look at the customer table to see an example column that uses this data type. I'll simply select all of the columns from sales.customers. Now, in this data table, the newsletter column over on the far right is used to track whether each customer has opted in to receive our promotional emails. Here in pgAdmin, that data is represented by the text true or false. Other graphical interfaces may display this data with checkboxes or other text to indicate the Boolean value, but they all represent the same thing. In this case, Bread Express, Green Gardens and Delish Food have all opted out of the newsletter, indicated by false here in the column. The other three customers have agreed to receive the promotions and their values are set to true. Now, just like our other data, we can use grouping…
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
-
-
-
Using GROUP BY to aggregate data rows7m 9s
-
(Locked)
Obtain general-purpose aggregate statistics5m 16s
-
(Locked)
Evaluate columns with Boolean aggregates4m 37s
-
(Locked)
Find the standard deviation and variance of a dataset5m 18s
-
Include overall aggregates with ROLLUP4m 14s
-
Return all possible combinations of groups with CUBE3m 38s
-
(Locked)
Segmenting groups with aggregate filters4m 57s
-
(Locked)
Solution: Group statistics with filters5m 7s
-
-
-
-
-
-
-