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 in the WHERE condition to IS NULL.
B
Add NOT in front of NULL.
C
Change = to <> NULL.
D
No change needed; the query is correct.
Correct answer: Change the operator in the WHERE condition to IS NULL.
Explanation
Quick AnswerThe correct answer is Change the operator in the WHERE condition to IS NULL. because it directly addresses the core logic of Database Management.
NULL comparisons require IS NULL / IS NOT NULL. Using = NULL always evaluates to UNKNOWN.