GATE | GATE-CS-2003 | Question 30

Consider the following SQL query

select distinct al, a2,........., an
from r1, r2,........, rm
where P 

For an arbitrary predicate P, this query is equivalent to which of the following relational algebra expressions ?
A: \prod_{a_{1},a_{2},...a_{n}}\sigma_{\rho} (r_{1}\times r_{2}\times r_{3}....\times r_{m})
B: \prod_{a_{1},a_{2},...a_{n}}\sigma_{\rho} (r_{1}\bowtie r_{2}\bowtie r_{3}....\bowtie r_{m})
C: \prod_{a_{1},a_{2},...a_{n}}\sigma_{\rho} (r_{1}\cup r_{2}\cup r_{3}....\cup r_{m})
D: \prod_{a_{1},a_{2},...a_{n}}\sigma_{\rho} (r_{1}\cap r_{2}\cap r_{3}....\cap r_{m})
(A) A
(B) B
(C) C
(D) D


Answer: (A)

Explanation:
Cross product (x) combines the tuples of one relation with all the tuples of the other relation. Thus, tuples of relation r1, r2 …. rn are combined.

Select operator \sigma is used to select resultant tuples.

Projection operator \prod_{a_{1},a_{2},...a_{n}} is used to select a subset of attributes from the resultant tuples by specifying the names of the attributes. So attributes a1, a2, an are projected from the resultant tuples.

 
Thus, option (A) is correct.

 
Please comment below if you find anything wrong in the above post.


Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.