📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

Which action violates referential integrity?

A. Deleting an unreferenced parent
B. Inserting a row with a NULL primary key
C. Inserting a child row whose foreign key has no matching parent ✅
D. Inserting a row with a duplicate primary key

Correct Answer: C. Inserting a child row whose foreign key has no matching parent

Explanation

Referential integrity requires every non-NULL foreign key to match an existing parent key, so an unmatched child row violates it.