📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

What must exist before a foreign key can be created?

A. The foreign key column must be null
B. The child table must be empty
C. The parent table must be empty
D. The referenced table and its primary key or unique key must already exist ✅

Correct Answer: D. The referenced table and its primary key or unique key must already exist

Explanation

A foreign key can only reference a primary key or a unique key that already exists in the parent table.