1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to BigQuery

Connected

Exercise

Logical aggregates

The last set of special aggregate functions you will use are the logical operators LOGICAL_AND and LOGICAL_OR. These provide an efficient way to find if any data set contains a true boolean. This helps when grouping by data to quickly see if all or one of those values is true. For example, this exercise will look at groups of data to see if they have been delivered or if at least one of the values has been delivered.

Instructions 1/2

undefined XP
  • 1

    Complete the query by using the LOGICAL_AND function on the order_status column to find customers with all orders marked as delivered.

  • 2
    • Complete the query by using the LOGICAL_OR function on the order_status column to find customers who have at least one order marked as shipped.