edited by
5,918 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.4k
views
3 answers
3 votes
go_editor asked Aug 20, 2016
2,434 views
Which of the following statements is correct?Aggregation is a strong type of association between two classes with full ownershipAggregation is a strong type of ... is a weak type of association between two classes with full ownership
5.8k
views
4 answers
5 votes
go_editor asked Aug 17, 2016
5,789 views
Consider the following ORACLE relations:R(A, B, C)={<1, 2, 3>, <1, 2, 0>, <1, 3, 1>, <6, 2, 3>, <1, 4, 2>, <3, 1, 4>}S(B, C, D)={<2, 3, 7>, <1, ... $_2$ thenM=4, N=2M=5, N=3M=2, N=2M=3, N=3
4.2k
views
3 answers
1 votes
go_editor asked Aug 17, 2016
4,218 views
Which of the following statements is true?$D_1$: The decomposition of the schema R(A, B, C) into R$_1$(A,B) and R$_2$(A,C) is always lossless$D_2$: The ... E) is losslessBoth $D_1$ and $D_2$Neither $D_1$ nor $D_2$Only $D_1$Only $D_2$
6.0k
views
1 answers
2 votes
Sanjay Sharma asked Jul 11, 2016
5,971 views
In distributed databases, location transparency allows for database users, programmers and administratirs to treat the data as if it is ... , A SQL query with location transparency needs to specifyInheritancesFragmentsLocationsLocal formats