Table Emp(id, bonus) has rows (1,500), (2,NULL), (3,NULL), (4,200). SELECT COUNT(*) FROM Emp WHERE bonus = NULL; What is the result?
Correct answer B. 0
Explanation
Comparing anything with NULL using = gives UNKNOWN, never TRUE, even when the stored value is itself NULL. WHERE keeps only rows where the condition is TRUE, so no row qualifies and the count is 0. The query is valid, so no error is raised. To find missing bonuses, write WHERE bonus IS NULL, which would return 2.
Answer checked How we write and check questions
Discussion