400. Departments with no employees — join challenge 3

DBMS Published Updated 0 Views Verified
Write the MySQL query for the following relational reporting requirement. Pay attention to unmatched rows and duplicate multiplication.
Looking for the latest Sarkari Result 2026 updates? Check the latest government exam results, merit lists and result updates on Sarkari Resultess.
Sarkari Resultess
Questions & Answers

Answer & Explanation

4 Answers
Verified Correct Answer

Option A

SELECT d.id, d.name FROM departments d LEFT JOIN employees e ON e.dept_id=d.id WHERE e.id IS NULL;
Additional Explanation
Correct implementation. Prefer parameterized queries in application code, validate affected rows for UPDATE/DELETE, and use transactions for related writes.
Sarkari Resultess
Editorial Answer 1
Verified

Option B

Use CROSS JOIN for the relationship.
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 2
Verified

Option C

Use INNER JOIN even when unmatched left rows must remain.
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 3
Verified

Option D

Join on unrelated text columns instead of the key.
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 4