Consider the following TSQL statement: SELECT ID, AVG(SALARY) AS \'AVG\' sum (SA
ID: 3576537 • Letter: C
Question
Consider the following TSQL statement: SELECT ID, AVG(SALARY) AS 'AVG' sum (SALARY) AS 'SUM', F_NAME as 'FIRSTNAME', L_NAME FROM EMPLOYEES GROUP BY ID HAVING L_NAME IS NOT NULL ORDER BY F_NAME, L_NAME This query results in an error. Which of the following statements correctly identifies the reason why? A The ORDER BY clause must use the aliases identified in the SELECT clause. B The HAVING clause must contain all aggregate columns. C The SELECT clause has incorrect use of aliases. D The GROUP BY clause must contain all non-aggregated columns.Explanation / Answer
Answer: The HAVING clause must contain all aggregate columns
A column in a HAVING clause must be either a grouping column or a column that refers to the result of an aggregate function.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.