Wednesday, 18 January 2012
Tuesday, 20 December 2011
Explain NOT NULL constraint in SQL Server.
Thursday, 1 December 2011
Explain the ALTER table statement in SQL Server.
Ex :
To ADD a column in a table,
ALTER TABLE Employees
ADD DateofBirth date
This Query will display a new column “DateofBirth” in date format to Employees table.
To DELETE a column in a table,
ALTER TABLE Employees
DROP column DateofBirth
This Query will delete the column “DateofBirth” from Employees table.
Sunday, 20 November 2011
Explain the TOP clause in SQL Server.
Labels: TOP clause in SQL Server
Wednesday, 16 November 2011
Explain ROUND () function in SQL Server.
Ex :
as EmployeeReimbursement
from Employees
This Query will display the Employee Name and the Employee Reimbursement rounded to the nearest integer.
Labels: ROUND () function in SQL Server
Thursday, 22 September 2011
Explain HAVING clause in SQL Server.
Labels: HAVING clause in SQL Server
Thursday, 18 August 2011
Explain GROUPBY function in SQL Server.
Labels: GROUPBY function in SQL Server
Wednesday, 3 August 2011
Explain LAST function in SQL Server.
Labels: LAST function in SQL Server
Monday, 1 August 2011
Explain FIRST function in SQL Server.
Labels: FIRST function in SQL Server
Wednesday, 27 July 2011
Explain AVG function in SQL Server.
Labels: AVG function in SQL Server
Friday, 22 July 2011
Explain SUM function in SQL Server.
Labels: SUM function in SQL Server
Thursday, 21 July 2011
Explain MAX function in SQL Server.
Labels: MAX function in SQL Server
Tuesday, 22 September 2009
Explain MIN function in SQL Server.
Select min(Employeeage) as MinimumAgedEmployee from Employees
Labels: MIN function in SQL Server
Tuesday, 24 February 2009
Explain COUNT () function in SQL Server.
Using COUNT (Column_Name) function
Where EmployeeName
Select count(distinct Employees) as NumberofEmployees from Employees
Labels: COUNT () function in SQL Server
Friday, 6 February 2009
Explain ALIASES clause in SQL Server.
The ALIASES clause is used to give another name for a column or a table. This is mostly used to show the output meaningful.
Using ALIAS in a Column
Labels: ALIASES clause in SQL Server
Wednesday, 28 January 2009
Explain DISTINCT clause in SQL Server.
The DISTINCT clause is normally used with SQL SELECT statement to get unique dataset entries from a database table.
from Employees
Labels: DISTINCT clause in SQL Server
Friday, 26 September 2008
What is BETWEEN operator in SQL Server?
The BETWEEN operator is used to view data between two values.
Select * from Employees
where Joiningdate
between ’06-Jan-2006’ and ’15-July-2007’
Labels: BETWEEN Operator in SQL Server
Sunday, 22 June 2008
Explain IN operator in SQL Server.
Ex :
Select EmployeeName, EmployeeID
from Employees
where City in (‘Chennai’, ‘Bangalore’)
This Query will display the Employee Name, Employee ID only from city “Chennai” and “Bangalore”.
Labels: IN condition in SQL Server
Wednesday, 19 September 2007
Explain AND & OR conditions in SQL Server.
The AND & OR is used to join two or more conditions in a WHERE clause.
where EmployeeName = ‘Steve’
and City = ‘
where EmployeeName = ‘Steve’
or City = ‘
This Query will display the each person with EmployeeName equal to “Steve” or City equal to “
Labels: AND, OR conditions in SQL Server
Monday, 10 September 2007
What is the difference between UNION and UNIONALL commands in SQLServer?
The UNION command is used to select the related data from two different tables, while using the UNION command all the selected columns have to to be of the same data type.
Select EmployeeName from Employees
union
Select EmployeeName from Department
Ex :
Select EmployeeName from Employees
union all
Select EmployeeName from Department
Labels: UNION, UNIONALL commands in SQL Server