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 in R and S I. Insert into R II. Insert into S III. Deletion from R IV. Deletion from S Which of the following can cause violation of the relational integrity constraint above?

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 in R and S I. Insert into R II. Insert into S III. Deletion from R IV. Deletion from S Which of the following can cause violation of the relational integrity constraint above? Correct Answer Both II and III

Concept:

  • A foreign key in a table refers to the primary key of another table. It contains a subset of entries of the primary key of another table.
  • It specifies the referential integrity constraint.

Explanation:

Given:

Two relations:

R(a, b, c) and  S(d, e, f)

d is the foreign key of S that refers to the primary key of R

Statement I: Insert into R

It will not cause a violation. Because the inserting element in R will not affect S. Values present in R’s primary key may or may not present in the foreign key of S.

Statement II: Insert into S

It will cause a violation. As d is the foreign key referring to the primary key of R. If we insert values in S, then that value must also be present in the primary key of R and which is not necessary as while inserting in S we are not aware of R.

Statement III: Delete from R

It will cause a violation. If we delete tuples from R relation, then if that tuple is present in S­ which is referring to the primary key of R must also be deleted.

Statement IV: Delete from S

It has no effect on the relation. It will not cause a violation. Values that are deleted from S need not be deleted from R. As S contains the foreign key.

Therefore statement II and statement III will cause violation of the relational integrity constraint

Related Questions

The following are the conditions for selecting list of a suitable candidates to be called for interview after the written test for the recruitment is conducted/ organized for management-level persons of a multi-national company. For providing accounting services and sales the candidate must (a) be holding a graduation in basic science with 65% or above or B.E degree with 55% and above marks (b) have passed the written test with 70% or above marks (c) the age must be in the group 25 to 30 yrs as on 1/4/18 (d) have experience in an accounting firms for three yrs and diploma in accounting with 60% or above marks (e) be presently drawing CTC of 6 Lakhs per annum and above In case the applicant who satisfies all other terms above except 1) at (a) above, then be referred as Junior Accountant 2) at (d) & (e) above then be referred as Trainee-Accountant Satisfying all the above with experience of 5 yrs then be referred as senior-Accountant Satisfying all the above criteria (a-e) with CA/ ICWA/ MBA (Finance) then be refereed as manager (Accounts) Read all the above information and answer the following question: Radha Mohan has done her graduation in physics with 58% of marks. She has passed the written examination with 76% of marks. She is 27 yrs as on June 2018. She has the experience in the accounting company for four years with salary of 7 Lakhs per annum. She also has passed diploma in accounting with 61% of marks. She may be referred for the position of: