SQL Fundamentals

NULL Handling: Interview

Why does column = NULL never match a missing value? NULL represents an unknown value. Comparisons with unknown produce UNKNOWN rather than TRUE, so SQL requires

Why does column = NULL never match a missing value?

NULL represents an unknown value. Comparisons with unknown produce UNKNOWN rather than TRUE, so SQL requires IS NULL or IS NOT NULL and uses three-valued logic in predicates.

Explain how NULL also affects NOT IN, arithmetic, aggregates, and joins.