Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE-CS-2003 | Question 30

  • Last Updated : 14 Feb, 2018

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)

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

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :