Connections with Boolean operators
You can choose among four Boolean operators in DML expressions: and, or, xor and not.
Value of left 
Value of right 
Value of left and right 

False 
False 
False 
True 
False 

True 
False 
False 
True 
True 
The following is the truth table for the or operator:
Value of left 
Value of right 
Value of left or right 

False 
False 
False 
True 
True 

True 
False 
True 
True 
True 
The and and or operators have a close relationship to common sense. Asking yourself questions similar to “Do I store the meat I’ve just bought in the fridge or the freezer?”, that involve the words and or or, are quite the same as using the operators in expressions.
Value of left 
Value of right 
Value of left xor right 

False 
False 
False 
True 
True 

True 
False 
True 
True 
False 
With Boolean operators you can connect single tests to build bigger expressions that turn true or false in complex situations. Just similar to +, , * and / operators in a math formula, and, or, xor and not can be used as many as needed to match the correct situation. The following is the complete expression that detects whether a year is a leap year:
(remainder(%year, 4) = 0) and not(remainder(%year, 100) = 0) 
This expression evaluates to true only when the year is a multiple of four without being a century, except for centuries that are multiples of four hundred –the remainder function is used to determine whether a year is a multiple of 4, 100 or 400.
Highest priority
processed first 
not  and  xor  or 
Lowest priority
processed last 