To display the names of employees that are not assigned to a department. Evaluate this SQL statement: SELECT last_name, first_name FROM employee WHERE dept_id = NULL; Which change should you make to achieve the desired result?
Answer options
A
Change the = operator to IS NULL in the WHERE clause.
B
Add NOT in front of NULL.
C
Change = to <> NULL.
D
No change needed; the query is correct.
Correct answer: Change the = operator to IS NULL in the WHERE clause.
Explanation
NULL comparisons require IS NULL / IS NOT NULL. Using = NULL always evaluates to UNKNOWN.