Aggregate Functions
Aggregate Functions work on calculation on a set of values and return a single value. we often use aggregate functions with the GROUP BY and HAVING CLAUSE of the SELECT statement.
The following Various Aggregate Functions :-
1. AVG :- The AVG() Function, It return the average value of n.
Syntax :-
SELECT AVG (column_name)
FROM table_name
WHERE conditions;
2. COUNT :- The COUNT() Function, returns the number of rows.
Syntax :-
SELECT COUNT (column_name)
FROM table_name
WHERE conditions;
Syntax :-
SELECT MIN (column_name)
FROM table_name
WHERE conditions;
4. MAX :- The MAX() Function, returns the maximum value.
Syntax :-
5. SUM :- The SUM() Function, returns the sum of column.
SELECT MAX (column_name)
FROM table_name
WHERE conditions;
Syntax :-
SELECT SUM (column_name)
FROM table_name
WHERE conditions;
0 Comments