Recall & Review
beginner
What does the SQL condition
IS NULL check for?It checks if a column's value is missing, meaning it has no data stored (NULL).
Click to reveal answer
beginner
How do you select rows where a column is NOT empty in SQL?
Use
WHERE column_name IS NOT NULL to find rows where the column has some value.Click to reveal answer
intermediate
Why can't you use
= NULL to check for NULL values in SQL?Because NULL means unknown or missing data, and
= compares values. Use IS NULL instead.Click to reveal answer
beginner
Write a SQL query to find all employees without a manager (manager_id is NULL).
SELECT * FROM employees WHERE manager_id IS NULL;
Click to reveal answer
beginner
What is the difference between
IS NULL and IS NOT NULL in a WHERE clause?IS NULL finds rows where the column has no value. IS NOT NULL finds rows where the column has some value.Click to reveal answer
Which SQL clause correctly finds rows where the 'email' column has no value?
✗ Incorrect
IS NULL checks for missing values. = NULL is invalid for this check.
What does
WHERE phone_number IS NOT NULL do?✗ Incorrect
IS NOT NULL filters rows with any value present in the column.
Why is
WHERE column = NULL not correct in SQL?✗ Incorrect
NULL means unknown or missing, so = comparison doesn't work; use IS NULL.
Which query finds all records where 'birthdate' is known (not missing)?
✗ Incorrect
IS NOT NULL filters rows where the column has a value.
If you want to find rows where a column 'score' is missing, which is correct?
✗ Incorrect
IS NULL finds missing or unknown values.
Explain how to use
IS NULL and IS NOT NULL in a SQL WHERE clause and why they are important.Think about how databases store missing information.
You got /4 concepts.
Write a simple SQL query to find all records where the 'address' field is missing.
Use IS NULL to check for missing data.
You got /3 concepts.