edited by
28,943 views
59 59 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$

5 Answers

Best answer
60 60 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.

edited by
15 15 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
3 3 votes

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

1 1 vote

BEST ANSWER

r1(P, Q, R)                    P and R are Primary key  so all Tuples are unique

Total tuples= 2000



  r2(R, S, T) 

 Total tuples= 2500    

R is common attribute in both the tables

the minimum and maximum cardinality will be Min(r1,r2) = Min(2000, 2500) = 2000

So correct answer is (a)   i.e 2000

Answer:
Position:
Show:

Related questions

91 91 votes
8 answers 8 answers
47.8k
47.8k views
Kathleen asked Sep 18, 2014
47,760 views
Consider the following relation schema pertaining to a students database:Students (rollno, name, address)Enroll (rollno, courseno, coursename)where the primary keys are s...
0 0 votes
1 1 answer
1.1k
1.1k views
anupamsworld asked Aug 7, 2022
1,125 views
In relational databases, the natural join of two tables:Can be equivalent to cartesian product of these two tablesIs combination of union and filtered cartesian productIs...
0 0 votes
1 1 answer
2.5k
2.5k views
aditi19 asked May 7, 2019
2,480 views
Product(maker, model, type)PC(model, speed, ram, hd, price)Laptop(model, speed, ram, hd, screen, price)Find those manufacturers of at least two different computers (PC’s ...
0 0 votes
0 0 answers
552
552 views
aditi19 asked Nov 2, 2018
552 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?