📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

After a parent row is deleted, the child rows remain but their foreign key becomes empty. Which referential action caused this?

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

Correct Answer: D. ON DELETE SET NULL

Explanation

ON DELETE SET NULL keeps the child rows and sets their foreign key to NULL when the parent row is deleted.