Let R1 (a, b, c) and R2 (x, y, z) be two relations in which a is the foreign key of R1 that refers to the primary key of R2 . Consider following four options.
(a)Insert into R 1
(b)Insert into R 2
(c)Delete from R 1
(d)Delete from R 2
Which of the following is correct about the referential integrity constraint with respect to above?
(A) Operations (a) and (b) will cause violation.
(B) Operations (b) and (c) will cause violation.
(C) Operations (c) and (d) will cause violation.
(D) Operations (d) and (a) will cause violation.
Explanation: Let x is the primary key in R2(x, y, z)
Insert into R1 – Can cause violation because if we want to insert any value into a of R1, which is not in x of R2.
Insert into R2 – Can not cause violation
Delete from R1 – Can not cause violation.
Delete from R2 – Can cause violation if we delete any value of x in R2, then the value referred by a in R1 should also be deleted.
Hence, option (D) is correct.
Quiz of this Question