NULL comparisons produce UNKNOWN in SQL three-valued logic.

highlighted = computed this step

NULL makes truth three-valued

SQL predicates do not only produce TRUE or FALSE. When NULL participates in a comparison, the result is UNKNOWN. Note: the truth table is rendered as data.

three valued logic\text{three valued logic}

NULL comparisons are UNKNOWN

The recomputed truth table has row count 2. Note: UNKNOWN is not TRUE, so later WHERE filtering will drop it.

truth rows=2\text{truth rows}=2

SQL bag/multiset + three-valued NULL logic, deterministic but surprising; tiny finite tables; no engine/perf claims. Set algebra is Book 1.

Three-valued truth Truth arity 2 rows 2
Truth case truth null_compared_to_number UNKNOWN null_equals_null UNKNOWN

Summary

NULL is not an ordinary value in comparisons; it produces UNKNOWN. Note: this bag and NULL logic is Book Two territory; set algebra was Book One.

null summary\text{null summary}