663 views
0 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 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
Position:
Show:

Related questions

2 2 votes
1 1 answer
466
466 views
shc asked Jan 19
466 views
In SQL-92 (which is what GATE assumes), which columns are allowed in SELECT and HAVING, when GROUP BY is present or not ?Which columns/attributes can be aggregated or non...
0 0 votes
1 1 answer
528
528 views
Doraemon asked Apr 20, 2019
528 views
previous value of X=9Sf : w1(X, 5); w2(X, 8); a1;cascadeless schedu;e . what problem will the schedule face??
1 1 vote
0 0 answers
1.4k
1.4k views
Prince Sindhiya asked Oct 26, 2018
1,396 views
These queries are same they are retriving the fname ,lname of employee who have dependent with same first name ,lname as that of employee - my doubt is that in second que...
0 0 votes
1 answers 1 answer
1.1k
1.1k views
Prince Sindhiya asked Sep 12, 2018
1,101 views
Consider the entity type DEPENDENT, related to EMPLOYEE, which is used to keeptrack of the dependents of each employee via a 1:N relationship,(assume dependent is weak en...