GATE / CS ARCHIVE

GATE CSE 1997 / QUESTION 6.10

Operations that can violate a foreign key

Database Management Systems · Database Models, Architecture & ER Diagrams · Full GATE CSE 1997 paper

GATE 1997, Q6.10 2 marks · MCQ
Report issue

Database Models, Architecture & ER Diagrams

Question 6.10, GATE 1997: S.d references the primary key of R. Which can violate this reference: insert R, insert S, delete R, delete S?
Question 6.10, GATE 1997: S.d references the primary key of R. Which can violate this reference: insert R, insert S, delete R, delete S?
Tap to enlarge
Your answer
Answer & solution

Answer: D: insert S and delete R (no official key was published)

Inserting into S can introduce a nonnull d value absent from R. Deleting a referenced row from R can leave existing S rows without a parent. These are operations 2 and 3, D. Inserting a valid new R row cannot remove an existing reference target; deleting an S row removes a referencing requirement. This concerns the foreign-key constraint specifically, not a separate duplicate-primary-key violation on insertion into R. A DBMS may reject or cascade dangerous operations, but those enforcement policies do not change which raw changes can create a violation.

Original paper, page 6