Which of the following correctly identify the requirements for a column to be part of the result set of a query that contains a GROUP BY clause?
[3253,3254]
Correct:
--> The column must be included in the GROUP BY clause
--> The column must contain an aggregate value
Explanation:
Answers B and C are correct. In standard SQL, if a GROUP BY column is present, all the columns that are part of the result set must either be aggregate values or be part of the GROUP BY statement itself. Some DBMSs—notably, MySQL—allow you to break these rules, but they do not behave in a standard way and your queries will not work if ported to other database systems.