Multiple choice technology databases

Which of the following is a SQL aggregate function

  1. LEFT

  2. LEN

  3. AVG

  4. JOIN

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

AVG is a standard SQL aggregate function that calculates the arithmetic mean of numeric values in a column. Other common aggregate functions include SUM, COUNT, MIN, and MAX, all of which perform calculations on multiple rows and return a single result.

AI explanation

To answer this question, we need to understand what SQL aggregate functions are.

SQL aggregate functions perform calculations on a set of values and return a single value as the result. They are used with the SELECT statement to perform operations such as calculating the average, sum, count, minimum, or maximum value of a column.

Let's go through each option to understand why it is correct or incorrect:

Option A) LEFT - This option is incorrect because LEFT is not an aggregate function. It is used to extract a specified number of characters from the left side of a string.

Option B) LEN - This option is incorrect because LEN is not an aggregate function. It is used to return the length of a string.

Option C) AVG - This option is correct because AVG is an aggregate function in SQL. It is used to calculate the average value of a column.

Option D) JOIN - This option is incorrect because JOIN is not an aggregate function. It is used to combine rows from two or more tables based on a related column between them.

The correct answer is C) AVG. This option is correct because AVG is a SQL aggregate function used to calculate the average value of a column.