edited by
5,724 views
3 votes
3 votes

Consider the relations $R(A, B)$ and $S(B, C)$ and the following four relational algebra queries over R ans S

  1. $\pi_{A, B} (R \bowtie S)$
  2. $R \bowtie \pi_B(S)$
  3. $R \cap (\pi_A(R) \times \pi_B (S))$
  4. $\Pi_{A. R. B} (R \times S)$ where $R.B$ refers to the column B in table R

One can determine that:

  1. I, III and IV are the same query
  2. II, III and IV are the same query
  3. I, II and IV are the same query
  4. I, II and III are the same query
edited by

2 Answers

Best answer
7 votes
7 votes

I think answer is 4

Let us take an example as R= {(10,1),(20,2)} and S={(2,30),(3,40)}

I)  R⟗S= {(20, 2,30)}. So π A, B R⟗S = {(20,2)}

II) π B (S) ={(2),(3)}. So R⟗π B (S) = {(20,2)}

III)  π A (R) X π B (S) ={10,20} X {2,3} ={(10,2),(10,3),(20,2),(20,3)}

R ∩ π A (R) X π B (S)={(20,2)}

IV) R X S = {(10,1,2,30),(10,1,3,40),(20,2,2,30),(20,2,3,40)}

π A, R.B R X S ={(10,2),(10,3),(20,2),(20,3)}

selected by
Answer:

Related questions

2 votes
2 votes
1 answer
4