Three-Valued Logic

The AND, OR, NOT, and IS logical operators of SQL work in three-valued logic.

These tables show the three-valued logic.

AND Operator

AND

TRUE

FALSE

UNKNOWN

TRUE

TRUE

FALSE

UNKNOWN

FALSE

FALSE

FALSE

FALSE

UNKNOWN

UNKNOWN

FALSE

UNKNOWN

OR Operator

OR

TRUE

FALSE

UNKNOWN

TRUE

TRUE

TRUE

TRUE

FALSE

TRUE

FALSE

UNKNOWN

UNKNOWN

TRUE

UNKNOWN

UNKNOWN

NOT Operator

TRUE

FALSE

UNKNOWN

FALSE

TRUE

UNKNOWN

IS Operator

IS

TRUE

FALSE

UNKNOWN

TRUE

TRUE

FALSE

FALSE

FALSE

FALSE

TRUE

FALSE

UNKNOWN

FALSE

FALSE

TRUE

Related concepts
SQL Operators
Subqueries in Search Conditions
Related reference
Comparison Conditions
Expressions
NULL Value
Search Conditions
Strings