Enter your email id to get regular update free
Your Email

What are SQL Aggregate functions and how to apply them?

In SQL an aggregate function is a function in which values of multiple rows are grouped together to form a single value of more significant measurement such as a set or a list etc

1.The COUNT() function returns the number of rows that matches a specified criteria. 
Syntax of COUNT() 
SELECT COUNT(column_name) 
FROM table_name 
WHERE condition;
2. The AVG() function returns the average value of a numeric column. 
Syntax of AVG() 
SELECT AVG(column_name) 
FROM table_name
 WHERE condition;
3.The SUM() function returns the total sum of a numeric column.
Syntax of SUM() 
SELECT SUM(column_name)
 FROM table_name 
WHERE condition;
4.The MIN() function returns the smallest value of the selected column. 
Syntax of MIN()
SELECT MIN(column_name)
 FROM table_name
 WHERE condition;
5. The MAX() function returns the largest value of the selected column.  
Syntax of MAX()
SELECT MAX(column_name) 
FROM table_name 
WHERE condition;
6.The FIRST() function returns the first value of the selected column. Syntax of FIRST()
SELECT FIRST(column_name)
 FROM table_name;
 WHERE condition;
6.The LAST() function returns the last value of the selected column. It can be used only in MS ACCESS. 
Syntax of LAST()
SELECT LAST(column_name) 
FROM table_name;
 WHERE condition;
Aggregate functions
SQL Aggregate functions
Tech writer at newsandstory
Total 734 views