ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
write query for fourth maximum salary from employee table
 Question Submitted By :: K L Baiju
I also faced this Question!!     Rank Answer Posted By  
 
  Re: write query for fourth maximum salary from employee table
Answer
# 1
select min(salary)
from (
  select top 4 *
  from employees
  order by salary desc
) as a
 
Is This Answer Correct ?    4 Yes 3 No
Ilgian
 
  Re: write query for fourth maximum salary from employee table
Answer
# 2
Select top 1 salary from (select top 4 salary from tbl_emp 
order by salary desc) temp_tbl order by asc
 
Is This Answer Correct ?    2 Yes 2 No
Yogendra Barode
 
 
 
  Re: write query for fourth maximum salary from employee table
Answer
# 3
For Finding Nth Salary...

SELECT TOP 1 Salary FROM
(SELECT TOP nth Salary FROM Table Order by Salary Desc)Table
As Sal Order by Salary
 
Is This Answer Correct ?    1 Yes 2 No
Dharmendra K. Dixit
 
  Re: write query for fourth maximum salary from employee table
Answer
# 4
select salary from employee aa
where 4=(select count(*)from employee bb
where aa.salary<=bb.salary)
 
Is This Answer Correct ?    1 Yes 0 No
Elumalai.k
 
  Re: write query for fourth maximum salary from employee table
Answer
# 5
if you have a table emp and you have to find fourth maximum 
salary from emp table then you will have to write this 
query.....

select top 1 sal from (select top 4 * from emp order by sal 
desc) as sal order by sal
 
Is This Answer Correct ?    0 Yes 0 No
Avanish Kumar
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What are the advantages of using stored procedures? Please don't simply say compilation time will be saved as they are already complied. Please specify some other advantages. 247Customer3
What is a cursor in SQL Server 2000 and their types?  4
what is the Surrogate key?and wt is the diff between Primary key and Surrogate Key?  2
What is an extended Stored Procedure?  1
you are provided with the single table having say 4 col ie fname lname age city , now the all records with displying of only fname and lname is required but in this format say my name is abhay khanna it will come like this abhay-khanna rahul-roy gaurav-singh the above format is required  2
What is the system function to get the current user's user id? HCL1
What r sql reporting services and analysis services? how can we use it. Microsoft2
how to count datewise data in sqlserver IndusInd-Bank3
In which year relase the 7.0& 2000 & 2005?  1
hi i gone though satyam interview. what is Acid Properties? Satyam2
how to select 5 to 7 rows from a table, which contains 10 rows? IBM14
Explain different isolation levels?  3
write the query for taking database restore in sql?  2
what is the cursor life span? Evalueserve5
As a part of your job, what are the DBCC commands that you commonly use for database maintenance? HCL1
what is the maximum size of a row in sql server 2000 and 2005  2
What is a sub-query? When would you use one?  3
what is hash table Teledata2
What do u mean by orphan users, how will u list them in the DB IBM2
create procedure proc1 (@a int) as begin if @a=1 create table #temp(a1 int) else create table #temp(a1 int) end while executeing the above code it shows error like '#temp already exist' .why it shows an error? IBM5
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com