Logical operators v15

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. You can switch the left and right operand without affecting the result.