GATE 2026 DA – Question 26
Consider two relations r and s defined on the relational schemas R(A,B) and S(E,C), respectively. A is the primary key of R and E is a foreign key of S referencing A in R.
Which of the following operations will NEVER violate the foreign key constraint?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) Inserting records into relation r; (B) Deleting records from relation s
Explanation
The relation s holds the foreign key, so a row of s must refer to a row of r. Adding a row to r (the referenced table) cannot leave any row of s without a parent, and removing a row from s (the referencing table) cannot either. Removing a row from r can leave rows of s that point to it, and adding a row to s can refer to a key that does not exist in r.