Consider the table R(p,q,w) and queries given below: Q1: SELECT DISTI...
Consider the table R(p,q,w) and queries given below:
Q1: SELECT DISTINCT p,q FROM R ;
Q2: SELECT p,q FROM R GROUP BY p,q ;
Then which of the following statements are correct :
I Q1 and Q2 produce always same result
II The output of Q1 is subset of the output of Q2
III The output of Q2 is subset of the output of Q1
IV Q1 and Q2 produce different result
A. I and II
B. II and III
C. I only
D. III and IV
Answer
Q1 :It will produce distinct p,q from relation R
now for Q2: it will create group because of the group by command and we know group by give distinct row for p,q.but the result will be same in term of rows.So we can say Q1 and Q2 produce always same result.
0Comment