Back to subject
MySQL/NULL & IS NULL

Find What's Actually Missing

Practical lesson

Let's read a query that specifically hunts for missing data.

SELECT * FROM students WHERE age IS NULL; asks MySQL for every row where the age column has genuinely no value recorded not zero, not blank text, but truly absent.

In our current students table, both Ali and Sara have real age values (16 and 17), so this query correctly returns Empty set (0 rows) there's nothing missing to find yet.

If you inserted a new row like INSERT INTO students (id, name) VALUES (3, "Zara");, deliberately leaving age out, that row's age would become NULL automatically. Re-running this exact same query would then return Zara's row.

This distinction matters constantly in real data: "we don't know this student's age yet" (NULL) is a genuinely different fact than "this student is 0 years old" and IS NULL is the only correct tool for finding the first case.

Try it yourself
Code

Starter example

Code
SELECT * FROM students WHERE age IS NULL;
Live preview
Empty set (0 rows)