1.5k views

Consider the relations r1(P, Q, R) and r2(R, S, T) with primary keys P and R respectively. The relation r1 contains 2000 tuples and r2 contains 2500 tuples. The maximum size of the join r1⋈ r2 is :

1. 2000
2. 2500
3. 4500
4. 5000
retagged | 1.5k views

the common attribute is R and it is primary key in the second relation. hence the R value is distinct for 2500 rows. hence when we join max possible number of tuples is 2000

option A
selected by
@manu thakur it means here you are not considering integrity constraint(foreign key)
But even in maximum case how 0 (zero) is possible plz  explain

@manu sir i was talking regaring this .. where i was wrong , https://gateoverflow.in/2344/gate2010-43

@sid in this question , B is the key of Relation R and It contains 200 rows.

S has common attribute B and contains 100 columns.

Natural join will result in maximum 100 records and minimum 0.
okay :)

Let us see two scenarios with small number of tuples r1 having 5 tuples and r2 with 3 tuples.

Scenario 1: when all the attributes in R in r1 do not match value of R in r2.

 P Q R 5 m 1 6 n 2 7 o 2 8 p 5 9 q 6
 R S T 1 a m 2 b n 3 c u

natural join on r1 and r2 would give me

 P Q R S T 5 m 1 a m 6 n 2 b n 7 0 2 b n

Scenario 2:

There are no uncommon values for R between r1 and r2

 P Q R 5 m 1 6 n 2 7 o 2 8 p 2 9 q 1

Natural join would give

 P Q R S T 5 m 1 a m 6 n 2 b n 7 o 2 b n 8 p 2 b n 9 q 1 a m

So in this case we get the max number of tuples ,which is equal to the max number of tuples in relation r1.

Generalizing this inference we can derive that ans is a)2000 =max no of tuples in r1.

edited by
I guess r1 contain min no. Of tuples so the example isn't according to the question

Explanation on the other hand is very useful

@Jarvis Thanks for your explaination. Can you plz tell me what will be the minimum number of tuples according to your explaination..