Database Management
Accenture PrimermediumDatabase Management06 Function-Scalar & Aggregate

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.

Related Accenture Database Management questions

Practice more Accenture Database Management questions

PrimerDumps has 1400+ primer questions, 2026 mocks and coding hands-on — all free.