📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

Why should a foreign key be indexed in a large database?

A. To prevent NULL values
B. To encrypt the foreign key
C. To make the foreign key unique
D. To speed up joins and checks when the DBMS verifies that a referenced parent exists ✅

Correct Answer: D. To speed up joins and checks when the DBMS verifies that a referenced parent exists

Explanation

Joins and referential checks look up parent rows by key, so an index avoids scanning the whole parent table.