383 views
0 votes
0 votes

a) every column that appears in group by clause must appear in select statement.

b) every column that appears in select statement must appear in group by clause

out of these two what is a valid argument?

1 Answer

Best answer
2 votes
2 votes

Both statements are FALSE:

   Reference: Stackoverflow
   Relation : Table
   A         B        C
   Cat       10       False
   Dog       25       True
   Dog       20       False
   Cat       5        False
 

 Select A,count(*) from Table group by A,B  

This will make both statements false.

But  " Select A,C,count(*) from Table group by A,B  " is not allowed it violetes the First Normal Form And it is undefined behaviour since DBMS from vendors apply different-different method to solve this problem.
selected by

Related questions

0 votes
0 votes
0 answers
1
vishal burnwal asked Aug 22, 2018
719 views
If aggregate functions are used in the select clause along with attribute list we must use group by clause for grouping the attribute values ?SELECT a1, COUNT(*) FROM Emp...
2 votes
2 votes
1 answer
2
Parshu gate asked Nov 6, 2017
3,920 views
0 votes
0 votes
2 answers
3
shikharV asked Dec 8, 2015
545 views
ABC52110NULL21523In the above relation T the output of query:select * from T group by B;ABC10NULL2521Can anyone explain why this is the output?
0 votes
0 votes
1 answer
4
Doraemon asked Apr 20, 2019
284 views
previous value of X=9Sf : w1(X, 5); w2(X, 8); a1;cascadeless schedu;e . what problem will the schedule face??