• edited by
20,627 views
66 66 votes

Suppose $R_{1} (\underline{A}, B)$ and $R_{2} (\underline{C}, D) $ are two relation schemas. Let $r_{1}$ and $r_{2}$ be the corresponding relation instances. $B$ is a foreign key that refers to $C$ in $R_{2}$. If data in $r_{1}$ and $r_{2}$ satisfy referential integrity constraints, which of the following is ALWAYS TRUE?

  1. $\prod_{B}(r_{1})- \prod _{C}(r_{2})= \varnothing$
  2. $\prod_{C}(r_{2})- \prod _{B}(r_{1})= \varnothing$
  3. $\prod_{B}(r_{1}) = \prod _{C}(r_{2})$
  4. $\prod_{B}(r_{1}) - \prod _{C}(r_{2}) \neq \varnothing$

4 Answers

Best answer
70 70 votes

Answer is A.

Referential integrity means, all the values in foreign key should be present in primary key.

$r2(c)$ is the super set of $r1(b)$

So, {subset - superset} is always empty set.

• edited by
13 13 votes

Child - Parents = Game Over  

Answer is A. 

• edited by
5 5 votes
Though foreign key values in B(r1) may be more than primary key values in C(r2), but here we use Relational Algebra query and operator is projection $\prod$, which doesn't retain duplicates. So, $\prod B(r1)-\prod C(r2) = \phi$
2 2 votes

Correct me if I am wrong:

A: B might not use some values of C. But B cannot have anything that C doesn't contain. So the difference will be phi. This is the Ans.

B: Same as option A, C might have values that B doesn't use so the diffenerce cannot be phi here. Moreover the Q askes which one is always true, this one might not be true in some cases.

C: Same argument, B and C might not be equal always.

D: Difference is phi, proven in option A.

Answer:
Position:
Show:

Related questions

69 69 votes
5 answers 5 answers
23.6k
23.6k views
go_editor asked Apr 21, 2016
23,585 views
Consider the following relations $A, B$ and $C:$ $$\overset{\textbf{A}}{\begin{array}{|c|c|c|}\hline\\\textbf{Id}& \textbf{Name}& \textbf{Age} \\\hline12& \text{A...
108 108 votes
9 answers 9 answers
46.3k
46.3k views
gatecse asked Sep 29, 2014
46,272 views
Consider the following relations $A, B$ and $C:$$$\overset{\text{A}}{\begin{array}{|c|c|c|} \hline \text {ID} & \text {Name} & \text {Age} \\\hline\text{12}& \text{Arun}...
106 106 votes
10 answers 10 answers
37.5k
37.5k views
Arjun asked Sep 25, 2014
37,524 views
Consider the following transactions with data items $P$ and $Q$ initialized to zero:$${\begin{array}{|c|l|r|c|}\hline \textbf{$T_1$}& \text{read (P);}\\ & \text{read...
49 49 votes
7 answers 7 answers
26.5k
26.5k views
gatecse asked Aug 5, 2014
26,529 views
Given the basic ER and relational models, which of the following is INCORRECT?An attribute of an entity can have more than one valueAn attribute of an entity can be compo...