📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

What is a foreign key used for?

A. To store derived values
B. To uniquely identify rows in its own table
C. To enforce referential integrity between two tables ✅
D. To speed up sorting only

Correct Answer: C. To enforce referential integrity between two tables

Explanation

A foreign key ensures values in one table match existing primary key values in the referenced table.