Consider two database relations R and S having 3 tuples in R and 2 tuples in S. what is the maximum number of tuples that could appear in the natural join of R and S?

Consider two database relations R and S having 3 tuples in R and 2 tuples in S. what is the maximum number of tuples that could appear in the natural join of R and S? Correct Answer 6

Concept:

If there are two relations A and B with m and n number of tuples respectively. Then maximum number of tuples in their natural join will be m*n. Maximum tuples will be when one attribute will contain all same values as the other relation having same attribute.

Explanation:

Given: two relations R and S having tuples 3 and 2 respectively. 

So, their natural join will contain maximum of 3 * 2= 6 tuples.

Example:

Consider table R (a, b) as ;

a b
1 3
1 5

 

Relation S(a, c) as :

a c
1 2
1 4
1 6

Here, the natural join of R and S will be :

a b c
1 3 2
1 3 4
1 3 6
1 5 2
1 5 4
1 5 6
So, it contains total of 6 tuples.

Related Questions