47 47 votes Let $R (a, b, c)$ and $S(d, e, f)$ be two relations in which $d$ is the foreign key of $S$ that refers to the primary key of $R$. Consider the following four operations $R$ and $S$ Insert into $R$ Insert into $S$ Delete from $R$ Delete from $S$ Which of the following can cause violation of the referential integrity constraint above? Both I and IV Both II and III All of these None of these Databases gate1997 databases referential-integrity easy isro2016 + – Kathleen 14.9k views answer comment Share Follow Print See all 5 Comments 5 5 Comments reply Show 2 previous comments Deepak Poonia commented Oct 28, 2022 reply Follow flag UGC NET: https://gateoverflow.in/225817/ugc-net-cse-july-2018-part-2-question-69 1 1 replyShare ꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂ commented Mar 8, 2024 reply Follow flag @Deepak Poonia sir in ugc question they gave options with will shouldn't it be can or may be there right ? 1 1 replyShare Jayvijay Chauhan commented Sep 21 reply Follow flag Refer This For Future!!!OperationTarget TableCan cause violation?ReasonInsert$R$ (Parent)NoAdding a parent row creates no orphans.Insert$S$ (Child)YESThe new FK value $d$ might not exist in $R.a$.Delete$R$ (Parent)YESDeleting $a$ leaves child rows in $S$ referencing a missing row.Delete$S$ (Child)NoRemoving a child row leaves all parent rows intact.Update$R$ (Parent PK)YESModifying $a$ breaks references from existing rows in $S$.Update$S$ (Child FK)YESChanging $d$ to a non-existent $a$ breaks the link. 0 0 replyShare Please log in or register to add a comment.
Best answer 67 67 votes $$\overset{R}{\begin{array}{|c|c|c|} \hline \textbf {a (PK)} & \textbf {b} & \textbf {c} \\\hline \text{1} \\\hline \text{2} \\\hline \end{array}} \qquad \overset{S}{\begin{array}{|c|c|c|} \hline \textbf {d (FK referring to PK of R)} & \textbf {e} & \textbf{f} \\\hline \text{2} \\\hline \text{1} \\\hline \end{array}}$$ Insert into $R$ cannot cause any violation. Insert into $S$ can cause violation if any value is inserted into d of S, which value is not in a of R. Delete from $S$ cannot cause any violation. Delete from $R$ can cause violation if any tuple is deleted, and as a result a value in 'a' gets deleted which is referenced to by 'd' in $S.$ Correct Answer: $B$ Jarvis answered May 27, 2015 • edited May 19, 2019 by Naveen Kumar 3 Jarvis comment Share Follow See all 2 Comments 2 2 Comments reply Lakshman Bhaiya commented Jan 18, 2018 reply Follow flag This question build my referential integrity constraint concept very well 10 10 replyShare Mohammed_Shahed commented Nov 2, 2025 reply Follow flag Hey Aplogies if my thinking is too naive to think of given options in this way The questions says Insert into R, then second option says Insert into S, which is fine right, now 3rd options reads, Delete from R and then 4the options Delete from S, which also seems fine if followed in order as i did, but if followed individually, options B and C, can cause violation, so My question is how do i decided which appraoch to consider when solving/ underdstanding options like this as the question didnt mention to consider them as a group or an indvidual. My sincere aplogioes again, im this is too naive. 1 1 replyShare Please log in or register to add a comment.
8 8 votes 2-Insert into S and 3-Delete from R ,can cause Violation of the Referential integrity constraints. Hence ,ans is (B) Both II and III Warrior answered May 3, 2017 Warrior comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Option (B) Both (II) and (III) Voilates the refential integrity constraints!!! Anurag_Kesharwani answered May 2, 2025 Anurag_Kesharwani comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes BEST ANSWER akshay_123 answered Jun 23, 2025 akshay_123 comment Share Follow 0 reply Please log in or register to add a comment.