47. ON DELETE SET NULL

DBMS Published Updated 3 Views Verified
Keep an employee row but clear manager_id when the manager is deleted.
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

ALTER TABLE employees ADD CONSTRAINT fk_employee_manager FOREIGN KEY (manager_id) REFERENCES employees(id) ON DELETE SET 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

ON DELETE UPDATE;
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 2
Verified

Option C

ON DELETE REMOVE;
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 3
Verified

Option D

ON DELETE CASCADE is identical to SET NULL.
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 4