Recall & Review
beginner
What does NULL represent in SQL?
NULL represents a missing or unknown value in a database. It is not the same as zero or an empty string.
Click to reveal answer
beginner
What is the result of comparing NULL with any value using = or <>?
The result is UNKNOWN, which behaves like FALSE in WHERE clauses. NULL = NULL does not return TRUE.
Click to reveal answer
beginner
How do you properly check if a column value is NULL?
Use IS NULL or IS NOT NULL to check for NULL values instead of = or <>.
Click to reveal answer
intermediate
What is the result of NULL OR TRUE in SQL?
The result is TRUE because TRUE in OR makes the whole expression TRUE regardless of NULL.
Click to reveal answer
intermediate
Why does NULL cause three-valued logic in SQL?
Because NULL means unknown, comparisons can be TRUE, FALSE, or UNKNOWN, affecting query results and filters.
Click to reveal answer
What does the expression NULL = NULL return in SQL?
✗ Incorrect
NULL = NULL returns UNKNOWN because NULL means unknown value, so SQL cannot confirm equality.
Which SQL syntax correctly checks if a column 'age' is NULL?
✗ Incorrect
Use IS NULL to check for NULL values. = NULL or <> NULL do not work as expected.
What is the result of the condition NULL AND TRUE?
✗ Incorrect
NULL AND TRUE returns UNKNOWN because NULL means unknown, so the result is unknown.
If a WHERE clause condition evaluates to UNKNOWN, what happens to that row?
✗ Incorrect
Rows with conditions evaluating to UNKNOWN are excluded from query results.
Which logical operator can turn a NULL value into TRUE in an expression?
✗ Incorrect
OR with TRUE returns TRUE even if the other operand is NULL.
Explain how NULL affects comparison operations in SQL and how to properly check for NULL values.
Think about why NULL = NULL is not TRUE.
You got /3 concepts.
Describe the three-valued logic in SQL caused by NULL and how it impacts query filtering.
Consider how NULL changes AND, OR, and NOT results.
You got /3 concepts.