Concept Flow - IS NULL vs equals NULL
Start Query
Check Condition
Return True
Filter Rows
Result Set
The query checks each row's column with IS NULL or = NULL. IS NULL returns true for NULLs, = NULL returns unknown, so no rows match.
SELECT * FROM users WHERE email IS NULL; SELECT * FROM users WHERE email = NULL;
| Step | Row email value | Condition | Evaluation | Row Included in Result? |
|---|---|---|---|---|
| 1 | NULL | email IS NULL | TRUE | Yes |
| 2 | NULL | email = NULL | UNKNOWN (treated as FALSE) | No |
| 3 | 'user@example.com' | email IS NULL | FALSE | No |
| 4 | 'user@example.com' | email = NULL | UNKNOWN (treated as FALSE) | No |
| 5 | '' (empty string) | email IS NULL | FALSE | No |
| 6 | '' (empty string) | email = NULL | UNKNOWN (treated as FALSE) | No |
| Variable | Start | After Row 1 | After Row 2 | After Row 3 | After Row 4 | After Row 5 | After Row 6 |
|---|---|---|---|---|---|---|---|
| N/A | NULL | NULL | 'user@example.com' | 'user@example.com' | '' | '' | |
| email IS NULL | N/A | TRUE | TRUE | FALSE | FALSE | FALSE | FALSE |
| email = NULL | N/A | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
IS NULL checks if a value is NULL and returns TRUE for NULLs. Using '=' to compare with NULL returns UNKNOWN, treated as FALSE. Use IS NULL to find NULL values in SQL queries. Example: WHERE column IS NULL returns rows with NULLs. WHERE column = NULL returns no rows. Always use IS NULL for NULL checks.