The GATE Grind

GATE 2026 DA – Question 26

Database Management and Warehousing · Integrity constraints and normal forms · 1 mark · Multiple select

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?

  1. Inserting records into relation r
  2. Deleting records from relation s
  3. Deleting records from relation r
  4. Inserting records into relation s

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.