Recall & Review
beginner
Why does the expression
column = NULL fail to return expected results in SQL?Because
NULL means unknown or missing value, and comparing anything to NULL with = does not return true or false but unknown, so the condition fails.Click to reveal answer
beginner
What is the correct way to check if a column value is NULL in SQL?
Use
IS NULL or IS NOT NULL instead of = NULL or <> NULL.Click to reveal answer
beginner
What does NULL represent in a database?
NULL represents a missing, unknown, or undefined value, not zero or empty string.
Click to reveal answer
intermediate
Why does
NULL = NULL return false or unknown in SQL?Because NULL means unknown, comparing two unknowns does not guarantee equality, so the result is unknown, not true.
Click to reveal answer
intermediate
How does SQL treat logical operations involving NULL?
SQL uses three-valued logic: true, false, and unknown. Any comparison with NULL results in unknown unless handled with
IS NULL or IS NOT NULL.Click to reveal answer
Which SQL expression correctly checks if a column
age is NULL?✗ Incorrect
The correct way to check for NULL is using
IS NULL. Using = NULL does not work because NULL means unknown.What does NULL mean in SQL?
✗ Incorrect
NULL means the value is unknown or missing, not zero or empty.
What is the result of
NULL = NULL in SQL?✗ Incorrect
Comparing NULL to NULL results in unknown because NULL means unknown value.
Which logical system does SQL use when dealing with NULL?
✗ Incorrect
SQL uses three-valued logic: true, false, and unknown (NULL).
If you want to find rows where a column is NOT NULL, which is correct?
✗ Incorrect
Use
IS NOT NULL to check for values that are not NULL.Explain why using
= NULL in SQL does not work as expected.Think about how SQL treats unknown values in comparisons.
You got /3 concepts.
Describe how SQL handles logical operations involving NULL values.
Consider the difference between NULL and normal values.
You got /3 concepts.