What Is Boolean Logic ?



In this reading, you will explore the basics of Boolean logic and learn how to use multiple conditions in a Boolean statement. These conditions are created with Boolean operators, including AND, OR, and NOT. These operators are similar to mathematical operators and can be used to create logical statements that filter your results. Data analysts use Boolean statements to do a wide range of data analysis tasks, such as creating queries for searches and checking for conditions when writing programming code.

B​oolean logic example

Imagine you are shopping for shoes, and are considering certain preferences:
  • You will buy the shoes only if they are pink and grey
  • You will buy the shoes if they are entirely pink or entirely grey, or if they are pink and grey
  • You will buy the shoes if they are grey, but not if they have any pink
Below are Venn diagrams that illustrate these preferences. AND is the center of the Venn diagram, where two conditions overlap. OR includes either condition. NOT includes only the part of the Venn diagram that doesn't contain the exception.


Comments

Most Popular