131 views

Consider a relation R(A, B) that contains r tuples, and a relation S(B, C) that contains s tuples; assume r > 0 and s > 0. Make no assumptions about keys. For the following relational algebra expression, in terms of r and s the minimum and maximum number of tuples that could be in the result? given answer is: minimum:0, maximum: min(r,s)

according to me: minimum:0, maximum: r

| 131 views
0
$\pi _{B}(R)-(\pi _{B}(R)-\pi _{B}(S))=\pi _{B}(R)\bigcap \pi _{B}(S)$

min tuple=0 and maximum=min(r,s)
0
@amit166

it is correct that the expression reduces to the intersection operation. but from that expression we need to find the minimum and maximum.

minimum occurs when πB(R) and πB(S) are disjoint. in that case intersection will be 0.

maximum occurs when πB(R) is a subset of πB(S). in that case intersection will be R.
+1

@aambazinga

and also continue that,

maximum occurs when πB(R) is a subset of πB(S). in that case intersection will be R ===> r is minimum

maximum occurs when πB(R) is a superset of πB(S). in that case intersection will be S ===> s is minimum

so, for combning these two maximum occurs as min(r,s).

0

aambazinga  take it as simple

the Relation represent :  πB(R) ⋂ πB(S)

if (R<S) then MAX :  R

if (S <R ) then MAX : S

therefore min (R,S)

0
Actually it depends on minimum of the two relation