edited by
17,117 views
42 votes
42 votes

Consider the relations $r_{1}\text{(P, Q, R)}$ and $r_{2}\text{(R, S, T)}$ with primary keys $\text{P}$ and $\text{R}$ respectively. The relation $r_{1}$ contains $2000$ tuples and $r_{2}$ contains $2500$ tuples. The maximum size of the join $r_1⋈ r_2$ is :

  1. $2000$
  2. $2500$
  3. $4500$
  4. $5000$
edited by

4 Answers

Best answer
45 votes
45 votes

The common attribute is $\text{R}$ and it is the primary key in the second relation. So $\text{R}$ value should be distinct (primary key implies unique) for $2500$ rows. Hence when we do join, maximum possible number of tuples is $2000.$

Correct option is A.

14 votes
14 votes

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.

r1
PQR
5m1
6n2
7o2
8p5
9q6
r2
RST
1am
2bn
3cu

natural join on r1 and r2 would give me

PQRST
5m1am
6n2bn
702bn

Scenario 2: 

There are no uncommon values for R between r1 and r2

PQR
5m1
6n2
7o2
8p2
9q1

Natural join would give

PQRST
5m1am
6n2bn
7o2bn
8p2bn
9q1am

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
1 votes
1 votes

See the image below carefully in order to understand that the maximum cardinality of join operation is minimum tuples of R1,R2

Answer:

Related questions

0 votes
0 votes
0 answers
4
aditi19 asked Nov 2, 2018
299 views
in case of outer join for combining two tables, if there is no common attribute does it returns cartesian product just like natural join does?