How many Aggregate functions are available in SQL?

Asked: Apr 14, 2023

The aggregate function is used to determine and calculate several values in a table and return the result as a single number. For example, the average of all values, the sum of all values, and the maximum and minimum value among particular groupings of values.

The following syntax illustrates how to use aggregate functions:

  1. function_name (DISTINCT | ALL expression)

SQL provides seven (7) aggregate functions, which are given below:

  • AVG(): This function is used to returns the average value from specified columns.

  • COUNT(): This function is used to returns the number of table rows, including rows with null values.

  • MAX(): This function is used to returns the largest value among the group.

  • MIN(): This function is used to returns the smallest value among the group.

  • SUM(): This function is used to returns the total summed values(non-null) of the specified column.

  • FIRST(): This function is used to returns the first value of an expression.

LAST(): This function is used to returns the last value of an expression.

Asked by brijesh

Answers (0)

No answers yet. Be the first to answer!