IAE Academy

GATE 2026 DA Q.26: solution and answer

GATE 2026 · DAQ.26 · 1 mark · MSQ

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. (A)

    Inserting records into relation r

  2. (B)

    Deleting records from relation s

  3. (C)

    Deleting records from relation r

  4. (D)

    Inserting records into relation s

See the question in the paper

Answer and solution

ANSWER

The operations that never violate the foreign key are (A) inserting into r and (B) deleting from s.

Official answer: A, BSource: Official answer key, GATE 2026 DA (IIT Guwahati)

  1. S is the referencing (child) relation and R is the referenced (parent) relation. The foreign key requires that every non-null value of S.E appears as some value of R.A.

  2. (A) Inserting into r (parent): a new parent row only adds a possible key value. No existing child row loses its parent and no child row changes, so the foreign key cannot be violated. (Only the primary key of R could be violated, for example by a duplicate A, and that is a different constraint.) Correct.

  3. (B) Deleting from s (child): removing referencing rows cannot leave any remaining S.E value without a parent. The foreign key cannot be violated. Correct.

  4. (C) Deleting from r (parent): if a deleted A value is still referenced by some S.E, that child row becomes dangling. This can violate the constraint, unless a cascade or set-null action is defined. Not correct.

  5. (D) Inserting into s (child): a new row whose E is non-null and absent from R.A violates the constraint. Not correct.

  6. Rule: inserting into the parent and deleting from the child are always safe. Inserting into the child and deleting from the parent can violate the constraint. So the operations that never violate it are (A) and (B).

KEY IDEA

A foreign key only constrains the child's values. Adding a parent row or removing a child row cannot create a dangling reference. Adding a child row or removing a parent row can.

WATCH OUT FOR

Treating deletion from the parent as safe because the key is "still unique", or forgetting that inserting into the child needs a matching parent value. Both of these can violate the constraint.

From the GATE 2026 DA paper. Every question of this paper · Download the full paper · All 6 Normal forms questions, with notes

More Normal forms questions