DBMS Grand Test 1 Question32

+2 votes

Let R1(A,B) be a relation with primary key A & R2(A) be another relation. consider the following foreign key constraints:

I . A is a foreign key in R1 referencing primary key A in R2

II. A is a foreign key in R2 referencing primary key A in R1

(A) |R1| < |R2|

(B) |R2| < |R1|

(C) |R1| = |R2|

(D) None

asked Sep 10, 2016 in DBMS by getgatebook (36,850 points)
reshown Dec 23, 2018 by getgatebook

2 Answers

0 votes
can anyone explain it ?
answered Oct 29, 2016 by (280 points)
0 votes
COnsider where |R1| > |R2|

R1 = (1,2))(1,3)(1,4)    R2=(1)   .......................(1)

 

COnsider where |R1| = |R2|

R1 = (1,2))(2,3)(3,4)    R2=(1)(2)(3)   ...................(2)

 

We cant have |R1| < |R2|

 

So, all in all, |R1| >= |R2|

So, D is the answer.
answered Nov 12, 2016 by (450 points)
Why can't we have |R1|<|R2| ..?
What if R1 = (1,2)(2,3)(3,4)    R2=(1)(2)(3)(4) ...?
Here A in R1 is a FK referencing to PK (A) in R2
Answer:
...