Wednesday, 27 July 2011

Explain AVG function in SQL Server.

The AVG function is used to return the average value of a numeric column.
Ex :
Select avg(EmployeesSalary) as AverageSalary from Employees
This Query will display the average value of “EmployeesSalary” column fields, the output will be displayed with the column name ”AverageSalary”.

Labels:


Bookmark this Blog in your Favorites

Friday, 22 July 2011

Explain SUM function in SQL Server.

The SUM function is used to total sum of a numeric column.
Ex :
Select sum(EmployeesSalary) as TotalEmployeesSalary from Employees
This Query will display the sum of all the “EmployeesSalary” column fields, the output will be displayed with the column name “TotalEmployeesSalary”.

Labels:


Bookmark this Blog in your Favorites

Thursday, 21 July 2011

Explain MAX function in SQL Server.

The MAX function is used to find the highest value in a particular column.
Ex :
Select max(EmployeeAge)as MaximumAgedEmployee from Employees
This Query will display the highest age of the employee from “EmployeeAge” column, the output will be displayed with the column name “MaximumAged Employee”.

Labels:


Bookmark this Blog in your Favorites