SQL NULL logic table
Inspect AND, OR, NOT and WHERE inclusion for TRUE, FALSE and UNKNOWN. See how NULL propagation differs from ordinary binary Boolean logic.
The example value has been entered. Check it immediately or change the value.
Input is processed in the browser. Refreshing returns a sample value.
Instructions and example
AND with FALSE is FALSE; OR with TRUE is TRUE. Otherwise unresolved results are UNKNOWN, and WHERE retains only TRUE.
UNKNOWN AND FALSE is FALSE; UNKNOWN OR FALSE is UNKNOWN; WHERE UNKNOWN filters the row out.
Evaluates selected truth values without executing SQL text. NULL comparisons and database-specific type coercion are excluded.
Frequently asked questions
Is UNKNOWN equivalent to FALSE?
No. WHERE excludes both, but NOT UNKNOWN remains UNKNOWN.
Does this SQL logic table connect to a database?
No. It computes the selected truth-value rules locally.
Calculation criteria and reference materials
- PostgreSQL — Logical operators
AND with FALSE is FALSE; OR with TRUE is TRUE. Otherwise unresolved results are UNKNOWN, and WHERE retains only TRUE.
Verification of calculation criteria: · Calculation·verification principles · Report errors