📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

In a Category table for an online store, how is a sub-category linked to its parent category?

A. By a foreign key to the Product table
B. By a ParentCategoryID foreign key referencing CategoryID in the same table ✅
C. By a foreign key to the Customer table
D. By copying the parent category row

Correct Answer: B. By a ParentCategoryID foreign key referencing CategoryID in the same table

Explanation

A category hierarchy is self-referencing, so each category may point to its parent category in the same table.