Consider two relations R(A,B) and S(E,C). A is primary key and E is a FK referring A. Which of the following operations never violate FK constraint?
Solution :
The correct options are Insert in R and Delete from S.
To understand why these operations never violate the Foreign Key (FK) constraint, let us analyze the relationship between the two relations, and .
Here, is the Primary Key (PK) of relation , and is a Foreign Key in relation that references in relation . The Foreign Key constraint requires that every value of in must either be null (if allowed) or exist as a value of in . That is, (excluding null values).
Let us evaluate each operation to see how it affects this constraint:
1. Insert in R:
When we insert a new tuple into the referenced relation , we add a new primary key value to . This expands the set of valid values that the foreign key can reference. Since it does not remove any existing primary keys, it cannot cause any foreign key in to point to a non-existent primary key in . Therefore, inserting into can never violate the foreign key constraint.
2. Delete from S:
When we delete a tuple from the referencing relation , we remove a foreign key value . Since the constraint only requires that existing foreign key values in must exist in , removing a row from simply reduces the referencing set. It cannot create an orphaned reference because we are removing references, not adding them. Therefore, deleting from can never violate the foreign key constraint.
For completeness, let us look at the other options:
- Insert in S: If we insert a tuple into with a foreign key value that does not exist in , the constraint is violated.
- Delete from R: If we delete a tuple from whose primary key is currently being referenced by some tuple's foreign key in , the constraint is violated (unless cascade actions are specified).
Completely free for students. Educators & coaching institutes get 2 months free Pro trial to create tests.
Access unlimited practice questions, detailed step-by-step solutions, and exam study materials — completely free for students.
Create and conduct professional online assessments with AI question generation, tab proctoring, and comprehensive batch management.
Prepare for GATE 2026 Civil Engineering with the latest question papers, previous year papers, detailed solutions, syllabus, exam pattern, preparation tips, mock tests, and subject-wise study material. Download GATE 2026 CE question papers with solutions in PDF format and boost your preparation for top engineering institutes and PSU recruitment.
Prepare effectively for GATE 2026 Electronics & Communication Engineering (EC) with this comprehensive Question Paper with Solutions. This resource includes detailed explanations, concept-wise solutions, previous year paper analysis, and exam-oriented practice to help aspirants strengthen core subjects like Electronic Devices, Analog Circuits, Digital Circuits, Signals & Systems, Network Theory, Control Systems, Electromagnetics, Communications, and more. Perfect for revision, self-assessment, and boosting your GATE 2026 EC preparation strategy.
Copyright © 2026 Combe Labs Private Limited. All Rights Reserved.