The Gateway to Computer Science Excellence
0 votes
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

please give answer with proper explanation.

in Databases by Active (3.4k points) | 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

Please log in or register to answer this question.

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
50,737 questions
57,384 answers
198,541 comments
105,340 users