The maximum size of the join r1⋈ r2 is

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
1Comment
shivani @shivani1234
25 Jul 2017 12:33 pm
  • Note: Natural join is cartesian product followed by selection.
  • Let us consider two relations r1(P, Q, R) and r2(R, S, T) 
    R1

    p q r
    1 e 3
    3 s 2
    4 a 3

     R2

    r s t
    3 q 1
    4 w 1
    2 d 3
    11 w 22
    5 tr 2

     

    then R1⋈R2 is
     

    p q r s t
    1 e 3 q 1
    3 s 2 d 3
    4 a 3 q 1

    therefore, maximum size of the join r1⋈ ris minimum of two relations, reason being r of R1 refers  to r of R2 so for every matching only there will be tuple in final natural join.

  • So, ans is min(2000,2500)= 2000.