Empowering CS learners, aspiring programmers, and startups with AI, Data Science & Programming insights — scaling skills from learning foundations to enterprise-grade solutions.
SQL NULL Explained: IS NULL vs = NULL in Simple Words
›Forums›SQL›SQL NULL Explained: IS NULL vs = NULL in Simple Words
Q: What happens if I write debut = NULL in SQL to find missing debut values? A: It won’t work as expected. The query will usually return zero rows, even if there are missing values.
Q: Why doesn’t debut = NULL work? A: Because in SQL, NULL means “unknown / missing”, and SQL cannot compare unknown values using =.
Q: What is the correct way to find rows where debut is missing? A: Use IS NULL like this:
SELECT id
FROM players
WHERE debut IS NULL;
Q: How do I find rows where debut is NOT missing? A: Use IS NOT NULL:
SELECT id
FROM players
WHERE debut IS NOT NULL;
✅ Quick Tip:
Whenever you want to check for missing values in SQL, always use IS NULL or IS NOT NULL, not =.