📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

A Parent Category is deleted with ON DELETE CASCADE on Category.ParentCategoryID. What is the risk?

A. No category is deleted
B. The products are deleted instead
C. The whole sub-category tree below it may be deleted recursively ✅
D. Only the parent row is deleted

Correct Answer: C. The whole sub-category tree below it may be deleted recursively

Explanation

CASCADE on a self-referencing key propagates down the hierarchy, removing all descendant categories.