Aggregate Functions :

-> Avg(numeric) returns numeric -> Min(numeric) returns numeric -> Max(numeric) returns numeric -> sum(numeric) returns numeric -> count(one column name or *) --this function will give total number of matched rows count. Rules: -> T-SQL will not support nested aggregate functions. -> Aggregate functions must not be used in where clause. Query to display average salary of all employees -> select avg(salary) as 'avgsal' from employees. Query for displaying min,max and average salary and sum of all employees salary. -> select min(salary),max(salary),avg(salary),sum(salary) from employees. Query to display minimum,maximum and average salary of .net employees. -> select min(salary),max(salary),avg(salary) from employees where dept .net

Count Function:

This function is use full for identifying total number of rows present in the final intermediate result sets. Ex: select count * from employees (or) select count(eid) from employees Query to display total number of android department employees. -> select count (*) from employees where dept='android' Query to display total number of employees count whose fnames are having character 'a' anywhere -> select count(*) from employees where fname like '%a%' Assignment: Query to display the employee details whose salaries are greater than average .net department employees salary.