2,706 views
0 votes
0 votes
From the following statements which of them is/are true about SQL

a) All attributes used in the group by clause must appear in the select clause

b) An SQL query can contain a having clause only if it has a group by clause

c) An SQL query can contain a having clause even if it does not have a group by clause

d) Not all attributes used in the group by clause need to appear in the select clause

1 Answer

0 votes
0 votes

Option A :

A group by command need to be applied to some attribute. So minimum of one attribute must be selected using select command.

Option B: 

Having command is used to qualify the group by command.

So having depends on group by.

 

Option  A and B are true!

Related questions

4 votes
4 votes
0 answers
1
GO Classes asked Feb 5
310 views
Consider the following schema (primary keys are underlined):Which of the following queries returns the department numbers of those departments for which there are no cour...