The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+22 votes
6.2k views

Consider the join of a relation $R$ with a relation $S$. If $R$ has $m$ tuples and $S$ has $n$ tuples then the maximum and minimum sizes of the join respectively are

  1. $m+n$ and $0$
  2. $mn$ and $0$
  3. $m+n$ and $|m-n|$
  4. $mn$ and $m+n$
asked in Databases by Veteran (52k points)
edited by | 6.2k views
–3
ans plz

1 Answer

+34 votes
Best answer

Answer is B.

$mn$
Case 1: if there is a common attribute between $R$ and $S$, and every row of $r$ matches with the each row of $s$- i.e., it means, the join attribute has the same value in all the rows of both $r$ and $s$,
Case 2: If there is no common attribute between $R$ and $S.$

$0$ There is a common attribute between $R$ and $S$ and nothing matches- the join attribute in $r$ and $s$ have no common value.

answered by Loyal (8.1k points)
edited by
+8
mn occurs during cartesian product of two relation ....

and 0 occurs during natural join of two realtion(In best case )....
+39

Join means Natural Join only.
Natural Join gives result as cartesian product if no attribute is matching in both relations.
eg- $R(A,B)$ and $S(C,D)$

Natural Join gives result as empty relation  if  at least one of the attribute matches but value does not matches.


In this case $R \Join S$ is empty.

0
Thanks @Sachin it  more clear now.
0
sachin sir shukriya
0

Join means Natural Join only.

in sql, it is ok... but in Relational Algebra, as per my knowledge, we can't say join means  Natural join

0
why in the above example R$\infty$S is { R JOIN S} IS EMPTY??

it should return  a3 b3 c1

isnt it??
0

@Shaik Masthan

can u pls give an example in which maximum size of join is m*n; i am getting size of join as max(m,n)

+1

why in the above example R∞S is { R JOIN S} IS EMPTY??

actually, there is a typo in previous image, corrected now !

 

can u pls give an example in which maximum size of join is m*n;

when no common attributes are there in the relations, then it is equivalent to cartesian product ==> m*n possible

0
is there any specific logic/ trick to how to find total no. of tuples when there is a common attribute!
0

Natural join acts on those matching attributes where the values of attributes in both the relations are same.

Can someone explain the involvement of Cartesian product in natural join. It is little bit confusing to me that is there any relation or concept that while doing natural join (not theta join just natural join) we have to do Cartesian product. 

 

Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,535 questions
54,122 answers
187,321 comments
71,039 users