Logical Operators v13

The usual logical operators are available: AND, OR, NOT

SQL uses a three-valued Boolean logic where the null value represents "unknown". Observe the following truth tables:

AND/OR Truth Table

aba AND ba OR b
TrueTrueTrueTrue
TrueFalseFalseTrue
TrueNullNullTrue
FalseFalseFalseFalse
FalseNullFalseNull
NullNullNullNull

NOT Truth Table

aNOT a
TrueFalse
FalseTrue
NullNull

The operators AND and OR are commutative, that is, you can switch the left and right operand without affecting the result.