edited by
11,037 views
47 votes
47 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$
edited by

4 Answers

Best answer
48 votes
48 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
6 votes
6 votes

child -parents = game over  :P  

Answer is A. 

3 votes
3 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$
1 votes
1 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:

Related questions

48 votes
48 votes
4 answers
1
go_editor asked Apr 21, 2016
13,583 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...
70 votes
70 votes
6 answers
2
gatecse asked Sep 29, 2014
29,076 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}...
70 votes
70 votes
7 answers
3