Relational Queries questions

Q15

GATE CS 2012 CSRelational QueriesMCQ1 mark−1/3 if wrong
Which of the following statements are TRUE about an SQL query?

P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause
Q : An SQL query can contain a HAVING clause only if it has a GROUP BY clause
R : All attributes used in the GROUP BY clause must appear in the SELECT clause
S : Not all attributes used in the GROUP BY clause need to appear in the SELECT clause
Show answer without attempting

Answer: C

Q50

GATE CS 2012 CSRelational QueriesMCQ2 marks−2/3 if wrong
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A∪BA \cup B is the same as that of AA.

(A∪B)⋈A.Id>40∨C.Id<15C(A \cup B) \bowtie_{A.Id > 40 \lor C.Id < 15} C
Show answer without attempting

Answer: A

Q51

GATE CS 2012 CSRelational QueriesMCQ2 marks−2/3 if wrong
How many tuples does the result of the following SQL query contain?
SELECT A.Id
FROM A
WHERE A.Age > ALL (SELECT B.Age
                   FROM B
                   WHERE B.Name = 'Arun')
Show answer without attempting

Answer: B

0/30 correct0 marks

Related topics in Databases