in Databases edited by
1,593 views
1 vote
1 vote

Consider the following two relations, $R(A, B)$ and $S(A, C)$:

$R$
$A$$B$
$10$$20$
$20$$30$
$30$$40$
$30$$50$
$50$$95$

$S$
$A$$C$
$10$$90$
$30$$45$
$40$$80$

The total number of tuples obtained by evaluating the following expression

$\sigma_{B<C}\left(R \bowtie_{R . A=S . A} S\right)$ is ___________.

in Databases edited by
by
1.6k views

1 Answer

1 vote
1 vote

The output of $R( \bowtie_{R.A=S.A} S)$ is simply return the number of tuples where $R.A$ value is equal to $S.A$. So the output is as follow:

A

B

C

10

20

90

30

40

45

30

50

45

from the above table now we have to perform $(\sigma_{B<C}(R \bowtie_{R.A=S.A} S))$. it return the number of rows where $B's$ value is less than $C$. so the output is:

A

B

C

10

20

90

30

40

45

 

So the given expression returns $2$ tuples as output.

Answer:

Related questions