📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

In a Folder system, each Folder may contain many Subfolders. How is this modelled?

A. By a foreign key to File only
B. By storing folder names in a list
C. By a separate Folder and Subfolder table with no link
D. By a ParentFolderID foreign key in Folder referencing FolderID in the same table ✅

Correct Answer: D. By a ParentFolderID foreign key in Folder referencing FolderID in the same table

Explanation

Folder hierarchy is recursive, so a folder points to its parent folder in the same table.