2. Group Functions
In sql, the following group function can operate on a whole table or
on a specific grouping of rows. Each function return's one result.
Group functions cannot be used in the where clause.
Group functions
AVG
COUNT
MAX
MIN
SUM
3. MIN
Min used with columns that store any data type to return the minimum
value
Example Result
Select MIN(Id) from WFP-countries 1
Select Min(country-name)from
wf_countries;
America
Select Min(hire-date)from employees; 17/Jun/1987
4.
5. MAX
Max used with columns that store any data type to return the maximum
value
Examples Result
Select Max(ID)from wf_countries; 100
Select Max(country-name)from
wf_countries;
Western Sahara
Select Max(hire-date)from employees; 29/june/2000
6.
7. Count
Returns the number of rows
The COUNT() function returns the number of rows that matches a specified
criteria.
Example Result
Select count(*)from Employee 206
8.
9. Sum
Sum used with columns that store numeric data to find the total or sum of
values.
Examples Result
Select Sum(area)from wf_countries
where region_id=29;
241424
Select Sum(salary)from employees
where department_id=90;
58000
10.
11. AVG
Avg used with columns that store numeric data to compute the average.
Example Result
Select avg(salary)from Emp; 50000