Which are true about aggregate functions? (Choose all that apply)

  1. You can use aggregate functions in any caluse of the SELECT statement.

  2. You can user aggregate funcitons only in column list of select clause and where clause of select statement.

  3. You can mix single row functions with aggregate functions in the column list of a SELECT statement by grouping on single row columns.

  4. You can pass column names, expressions, constants, or functions as parameter to an aggregate function.


Correct Option: A,D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) You can use aggregate functions in any clause of the SELECT statement. - This option is correct. Aggregate functions can be used in various clauses of the SELECT statement, such as the SELECT clause, WHERE clause, HAVING clause, and ORDER BY clause.

Option B) You can use aggregate functions only in the column list of the SELECT clause and WHERE clause of the SELECT statement. - This option is incorrect. Aggregate functions can be used in multiple clauses of the SELECT statement, not just the column list and WHERE clause.

Option C) You can mix single row functions with aggregate functions in the column list of a SELECT statement by grouping on single row columns. - This option is incorrect. Single row functions and aggregate functions cannot be mixed in the column list without proper grouping. If you want to use both, you need to group the single row columns appropriately.

Option D) You can pass column names, expressions, constants, or functions as parameters to an aggregate function. - This option is correct. Aggregate functions can accept various types of parameters, including column names, expressions, constants, and functions.

The correct answers are A and D. These options are correct because aggregate functions can be used in any clause of the SELECT statement and can accept different types of parameters.

Therefore, the correct answer is A and D.

Find more quizzes: