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

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…

Contents