.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
sritaa
Sandeep Singh
Melody Anderson
Sharad
Eminent IT


Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.


Post New Question Subscribe to Interview Questions
 
Quick Links For Interview Questions Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  OOPs  JQuery  JavaScript/VBScript
BiztalkPatten/PracticesIISWCFWPFWWF
NetworkingAptitudeOthers  All    
 

Sql Server Interview Questions and Answers

Write Query to get nth Lowest Salary in SQL Server

Author: volvo          Posted Date: November 21, 2013    Category: Sql Server     Points: 40

Select TOP 1 Salary as
from (SELECT DISTINCT TOP n Salary from Employee ORDER BY Salary ASC)
a ORDER BY Salary DESC

Write Query to get nth Highest Salary in SQL Server

Author: volvo          Posted Date: November 21, 2013    Category: Sql Server     Points: 40

Select TOP 1 Salary as
from (SELECT DISTINCT TOP nth Salary from Employee ORDER BY Salary DESC)
a ORDER BY Salary ASC

What is identity column in SQL server

Author: volvo          Posted Date: November 11, 2013    Category: Sql Server     Points: 40

The IDENTITY columns are auto incrementing columns provided by SQL Server.
There can only be one IDENTITY column per table.
SQL Server will take care of incrementing this column automatically

Syntax:
CREATE TABLE Contacts (
ContactID INT IDENTITY(1, 1),
FirstName VARCHAR(30),
LastName VARCHAR(30),
Phone VARCHAR(16)

)

Difference between stored procedure and function

Author: abhays          Posted Date: November 01, 2013    Category: Sql Server     Points: 40


1.Function must return a value but Stored Procedure can return 0(Zero) or n values
2.Functions have only input parameters but Procedures can have either input or output or both parameters .
3.Function must have one input parameter which is mandatory but 4.Stored Procedure may take 0 (Zero) to n input parameters.
5.Functions can be called from Procedure whereas Procedures cannot be called from Function.
6.Procedure contains DML statement whereas function allows only select statement.
6.Exception handling can be done in stored Procedure only

How to get sql Server version

Author: abhays          Posted Date: November 01, 2013    Category: Sql Server     Points: 40

select @@Version

What is the query to get second higest salary of Employee table?

Author: abhays          Posted Date: November 01, 2013    Category: Sql Server     Points: 40

select MAX(Salary) from Employee WHERE Salary NOT IN (select MAX(Salary) from Employee );

Which types of joins let you retrieve nonmatching data?

Author: Narayanan          Posted Date: April 12, 2013    Category: Sql Server     Points: 40

Full outer join and Left outer join

which is Faster Union or Union All?

Author: Narayanan          Posted Date: April 12, 2013    Category: Sql Server     Points: 40

Union All is faster than union in SQL Server

What is the symbol for creating temporary Table in SQL Server.

Author: Narayanan          Posted Date: April 12, 2013    Category: Sql Server     Points: 40

#

Why use Stored Procedures ?

Author: Narayanan          Posted Date: April 12, 2013    Category: Sql Server     Points: 40

Stored procedures allow a lot more flexibility offering capabilities such as conditional logic
Stored procedures are stored within the DBMS, bandwidth and execution time are reduced
Client developers are abstracted from complex designs




Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend