The aggregate functions are built-in functions of MYSQL which are used to return a single value after calculation of values in a column. Main aggregate functions and their example are as given below:

AVG()

The AVG() function returns the average value of an input column data while ignoring null values. The function calculates the average of the column "colMarks" from the table, "tblmarks" and assign it to "avg_marks", as shown in the example:

SELECT AVG(colMarks) avg_marks FROM tblmarks;

COUNT()

The COUNT() function returns the number of rows in an input column. The function gives the count of number of names in "name" column in the "tbldata", as shown in the example:

SELECT COUNT(name) AS population FROM tbldata;

MAX()

The MAX() function returns the maximum value of an input column. This function gives the maximum number from "marks" column of "tblmarks" table, as presneted bt the example below:

SELECT MAX(marks) AS first FROM tblmarks;

MIN()

The opposite from MAX(), the MIN() function returns the minimum value of an input column. This function gives the minimum number from "marks" column of "tblmarks" table, as shown by the example:

SELECT MIN(marks) AS last FROM tblmarks;

SUM()

The SUM() function returns the sum of values of an input column. The below example calculates the sum of cost of all items in the "colPrice" column in "tblproducts":

SELECT SUM(colPrice) FROM tblproducts;