PrepZone Logo
PrepZone
Back to Database

Database · Medium

How does NULL behave in SQL? Explain three-valued logic.

DatabaseFundamentalsFresherSQL

Answer preview

NULL is not a value — it is a marker for unknown or not applicable. Because any comparison with an unknown yields unknown, SQL uses three-valued logic: every predicate evaluates to TRUE, FALSE, or UNKNOWN, and WHERE keeps only rows that are TRUE.…