in Databases
801 views
0 votes
0 votes

Consider a relation r1(ABC), r2(CDE) and r3(EG) with primary keys A, C and E respectively. Assume that r1 has 1000 tuples, r2 has 1500 tuples and r3 has 750 tuples. The number of resultant tuple in are

 

in Databases
801 views

4 Comments

Thanks @Aditya_

1
1

@Aditya_ just wanted to clarify that suppose the no. of tuples would have been different like r1 = 100 r2 = 1000 and r3 = 1500 in this case the max number of tuples on applying natural join would have been 100 right?

0
0
1
1

1 Answer

1 vote
1 vote
Since it will be a natural join among them, therefore on the basis of common attribute.(but ,since the is a patent child relation between the common attribute and parent is a primary key therefore this will be an interesting case)

So first let's take r1 and r2

           Since, r2 have C as primary key therefore r1 cross r2 will have 1000 elements. Since if parent child relation exist therefore all the child's table rows of them will be taken.(your can check it via manually it's interesting)

Therefore now (ABCDE) cross r3

           Similarly, 1000 is the answer.
edited by

3 Comments

but r3 has only 750 tuples.so by natural join i thik only 750 tuples will come
0
0
But due to child parent relation and the parent is primary key therefore all the rows of child table will be selected when  a natural join will be there.
1
1
k.thank you
1
1