Yearly Archives: 2010

Renaming a column in Sql Server

By | September 6, 2010

 We often need to change the name of a column of a table to a new name. We  can do this with the help of the Exec Sp_rename command.  The Syntax of the Sp_rename is given below:-  Exec sp_rename ‘TableName.[OldColumnName]’, ‘[NewColumnName]’, ‘Column’  For example, suppose we have a table called Employee who has the following structure:-… Read More »

Interview Questions on sql server -Part-1

By | January 31, 2010

1. What is the Normalization? Normalization:-Normalization can be defined as the process of organization the data to reduce the redundant table data to the minimum. This process is carried out by dividing the database into two or more than two tables and defining relationship between them so that deletion, updation and insertion can be made… Read More »

Group by…..Having Clause

By | January 31, 2010

Group By:- Group By clauses is used to groups rows based on the distinct values of the specified columns. The syntax of the Group by clause is:-   Select column1, column2, column3, aggregate_function(expression )            From TableName Where (condition)            Group By Column1, column2, column3 For Example, suppose we have a… Read More »

Difference Between Having and Where Clause in Sql Server

By | January 31, 2010

Both Having Clause and Where clause is used to filter the data coming from the Select statement, but still there are some differences between them. These difference are given below:- To show the difference between the Where Clause and the Having clause we will going to use the table EmployeeDeptInfo whose create query statement  is… Read More »

Second Normal Form (2NF)

By | January 26, 2010

Second Normal Form (2NF) :-A table is said to be in its Second Normal Form if it satisfied the following conditions:- 1) It satisfies the condition for the First Normal Form (1NF), 2) It do not includes any partial dependencies where a column is dependent only a part of a primary key. For example suppose we have… Read More »