NULL means a field has no value. It is not zero and not an empty string.
You cannot test for NULL with =. Use IS NULL and IS NOT NULL.
COALESCE(column, 'default') (or IFNULL in MySQL/SQLite, ISNULL in SQL Server) replaces NULL with another value.
💡 Key Takeaways: SQL NULL Values
Mastering SQL NULL Values helps you write clean and reliable SQL code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.
SQL NULL Values Code Example
SQL
SELECT CustomerName, Email FROM Customers
WHERE Email IS NULL;
SELECT CustomerName, COALESCE(Email, 'no email on file') AS Email
FROM Customers;
Free sign-in required · Google login available
SQL NULL Values Practice Exercises
Check what you learned in “SQL NULL Values”.
/ 3 solved
Fill in the blank
Find customers without an email.
SELECT * FROM Customers WHERE Email ;
✓ Correct!Not quite. Try again.
Multiple choice
Why does "WHERE Email = NULL" not work?
✓ Correct!Not quite. Try again.
Code challenge
Select CustomerName of customers that DO have an email.
Write the code in the live editor. Your answer is checked automatically.