SQL Aggregate Functions

SQL aggregate functions return a single value, calculated from the values in a column. Aggregate functions are used to compute against a returned column of the numeric data from your SELECT statement.
 
Aggregate Functions
 
Consider the following table design as an example.
 
 

1. AVG():  This function computes the average of the values in the column

Ex. Select AVG(marks) from stud

O/P : 58

 
2. SUM(): This function computes the sum of the values in the column
 
Ex. Select SUM(marks) from stud
  
O/P : 235
 
3. MIN(): This function returns the minimum value from the values in the column

Ex. Select MIN(marks) from stud

O/P : 50

4. MAX(): This function returns the maximum value from the values in the column

Ex. Select MAX(marks) from stud

O/P : 70

  5. COUNT(): This function returns the number of rows

Ex. Select COUNT(*) from stud

O/P : 4

Next Recommended Reading Aggregate Function in SQL Server