UGC-NET Jul 2018 · ER-Model

MCQ · 2 marks · Problem DBMS-RELM-0049

Let \(R_1(a, b, c)\) and \(R_2(x, y, z)\) be two relations in which \(a\) is the foreign key of \(R_1\) that refers to the primary key of \(R_2\). Consider the following four operations.(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?
  1. A
    Operations (a) and (b) will cause violation
  2. B
    Operations (b) and (c) will cause violation
  3. C
    Operations (c) and (d) will cause violation
  4. D
    Operations (d) and (a) will cause violation

Solve it on GATE DA practice →More Relational Model & SQL problems

Show the worked solution\[\boxed{\text{every } R_1.a \text{ value must exist as a key in } R_2}\](a) Inserting into \(R_1\) a tuple whose \(a\) is not in \(R_2\): violation.(b) Inserting into the referenced relation \(R_2\) cannot break a reference.(c) Deleting from the referencing relation \(R_1\) cannot break a reference.(d) Deleting from \(R_2\) a key still referenced by \(R_1\): violation.So operations (d) and (a).Answer: D

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com