📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

Which foreign-key action is safest when a parent row is still referenced and must not be lost?

A. ON DELETE RESTRICT or NO ACTION ✅
B. ON DELETE SET NULL
C. ON DELETE CASCADE
D. ON DELETE SET DEFAULT

Correct Answer: A. ON DELETE RESTRICT or NO ACTION

Explanation

RESTRICT blocks the delete, so a referenced parent cannot be removed by mistake while children still depend on it.