0PricingLogin
SQL Academy · Lesson

NULL: The Third Truth Value

Master the meaning of NULL, why NULL is not equal to anything (not even itself), and how three-valued logic affects WHERE clauses.

What Is NULL?

NULL represents unknown or missing data. It is not zero, not an empty string, not false. It is the explicit absence of a value.

NULL Is Not Equal to Anything (Not Even Itself)

This is the rule that trips everyone up:

SELECT NULL = NULL;       -- NULL (not true!)
SELECT NULL = 0;          -- NULL
SELECT NULL = '';        -- NULL
SELECT NULL <> 1;         -- NULL

All lessons in this course

  1. What an RDBMS Is and Why Tables Matter
  2. Primary Keys and Uniqueness
  3. NULL: The Third Truth Value
  4. Data Types Overview: INT VARCHAR DATE BOOLEAN
← Back to SQL Academy