Oracle SQL - Truth Tables with NULL

Introduction

The following table shows the truth table of the NOT operator.

Op1 NOT (Op1)
TRUE FALSE
FALSE TRUE
UNKNOWN UNKNOWN

Op1 stands for the operand. Note that the negation of UNKNOWN is UNKNOWN.

The table below shows the truth table of the AND and OR operators; Op1 and Op2 are the two operands, and the truth table shows all nine possible combinations.

Op1 Op2 Op1 AND Op2 Op1 OR Op2
TRUETRUETRUE TRUE
TRUEFALSE FALSE TRUE
TRUEUNKNOWN UNKNOWN TRUE
FALSE TRUEFALSE TRUE
FALSE FALSE FALSE FALSE
FALSE UNKNOWN FALSE UNKNOWN
UNKNOWN TRUEUNKNOWN TRUE
UNKNOWN FALSE FALSE UNKNOWN
UNKNOWN UNKNOWN UNKNOWN UNKNOWN

AND and OR operators are symmetric: you can swap Op1 and Op2 without changing the operator outcome.

Related Topic