recategorized by
495 views
1 votes
1 votes

Let $\text{R}$ and $\text{S}$ be two relations with the following schema

$R(\underline{P,Q,}R1,R2,R3)$

$S(\underline{P,Q,} S1, S2)$

Where [P,Q] is the key for both schemas. Which of the following queries are equivalent?

(I) $II_P (R\bowtie S)$

(II) $II_P (R) \bowtie II_P (S)$

(III) $II_P(II_{P,Q} (R)-(II_{P,Q} (R)-II_{P,Q} (S)))$

  1. Only (I) and (II)
  2. Only (I) and (III)
  3. Only (I), (II) and (III)
  4. Only (I), (III) and (IV)
recategorized by

1 Answer

0 votes
0 votes
Let

R(p, q, r1, r2, r3)        and    S(p,q s1,s2)

<a,b,1,2,3>                         <a,b,8,7>

<c,d,4,5,6>                          <c,e,9,8>

 

1 natural join will give output as  <a,b> & then projection will give <a> as output

similarly 3 & 4 (both are also equivalent either way of representing intersection)

1,3,4 works both on P,Q.

Now the problem is in 2

first only P is projected from both sides and then joined

from R         from S

<a>     join     <a>

<c>                <c>

so it'll give output as

<a>

<c> which is certainly different from 1,3 & 4

So option D
Answer:

Related questions

1 votes
1 votes
1 answer
2
gatecse asked Dec 9, 2020
540 views
$(<\text{ALL})$ comparison operator means:more than the maximum value in the subqueryless than the minimum value in the subqueryis equivalent to $\text{IN}$none of the op...
2 votes
2 votes
1 answer
3
1 votes
1 votes
1 answer
4
gatecse asked Dec 9, 2020
490 views
Anomalies are avoided by splitting the offending relation into multiple relations, is also known as __________.AccupressureDecompositionPrecompositionBoth decomposition &...