1,846 views
8 votes
8 votes

Let  us consider 3 relations R1(ABD), R2(BCE) and R3(CF). The primary keys of R1 , R2 and R3 are A, B and C respectively. The number of  tuples  in R1, R2 and R3 are 50,40,80 respectively. Maximum size of R1*R2*R3 where

* denotes natural join.

1 Answer

Best answer
16 votes
16 votes

R1(ABD) , key is A, No.of tuples = 50.

R2(BCE) , key is B, No.of tuples = 40. 

R3(CF),     key is C, No.of tuples = 80.

Maximum size of R1*R2*R3 = ?? ,  where * denotes natural join.

First lets compute R1*R2, where common attribute is B, which is a key of R2. So B represents here foreign key for table R1 which refers the primary key of table R2. So every element of attribute B in R1 must be there in R2. So Maximum tuples return by R1*R2= 50.

Similarly, R1*R2 ( ABCDE) and R3 ( CF) have common attribute C, which is a key of R3. So C represents foreign key for table R1*R2 which refers the primary key of table R2. So every element of attribute C in R1*R2 must be there in R3 and here R1*R2 can have maximum 50 tuples where elements of attribute C in R1*R2 match with the 80 elements of attribute C in R3. So Maximum tuples return by R1*R2*R3 = 50.

selected by

Related questions

1 votes
1 votes
3 answers
1
Purple asked Jan 24, 2016
1,671 views
When , then the cost of computing is(A) the same as R S (B) greater the R S(C) less than R S (D) cannot say anything
1 votes
1 votes
1 answer
3
raginibhayana asked Feb 15, 2022
755 views
why don't we use the projection operator in conditional join?
0 votes
0 votes
0 answers
4
aditi19 asked May 8, 2019
775 views
how to write the query for natural join on three relations in SQL using the NATURAL JOIN clause?