📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

What happens if you try to insert a row with a foreign key value that does not exist in the parent table?

A. It is converted to NULL
B. It is rejected by the DBMS ✅
C. It is inserted with a warning
D. It is inserted and the parent row is created automatically

Correct Answer: B. It is rejected by the DBMS

Explanation

The DBMS enforces referential integrity and rejects the insert because the referenced parent does not exist.