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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
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
 
SQL stops working in every 15 days displaying message that database log file is full. Log file size is 3.95 GB. It is happening after shrinking the database also. What is solution to overcome this problem. Please help me as it's urgent.  4
I need a query that retrieves info from an Oracle table and a query that retrieves info from a SQL Server table. The info has to be joined together according to Record ID numbers. I have very limited access to the Oracle database but full control of the SQL Server database.How do I join two different queries from two different databases?  1
what is IDE,DMV in sql server? Value-Labs1
Hi..here i would like to know the Backup and Restore models? HCL2
How to select nth record from a table? DELL9
What command do we use to rename a db?  3
Which virtual table does a trigger use?  3
Name three version of sql server 2000 and also their differences?  1
How to list all tables having unique constraints in any of the columns in a database.  1
difference between sql server2000 and sql server2005 KPMG1
Can Having clause be used without Group by clause? CTS3
What is database replicaion? What are the different types of replication you can set up in SQL Server?  2
how to find out the repeated value from table using groupby function?  3
Following are some of the question related to below mentioned query? select e1.salary from employee3 e1 where 2= ( select count(distinct(e2.salary)) from employee3 e2 where e2.salary>=e1.salary ) 1) What the query returns? 2) How it works? - Detail explanation (what the sub query does, why it is (where 2=)....etc...Please?  3
What's the difference between a primary key and a unique key? Wipro8
Can you tell me the difference between DELETE & TRUNCATE commands?  11
Which virtual table does a trigger use? TCS5
WHY CAN WE CREATE ONLY ONE CLUSTERED INDEX ON A TABLE IN SQL SERVER?  6
how will u create "n" possible tables in sql... Oracle1
Is it possible to allow NULL values in foreign key? I s it possible to use different constraints for the same column in the table (i.e) (id int NOT NULL,UNIQUEUE)  1
 
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