ALLInterview.com :: Home Page            
 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                      
Google
   
 
Categories >> Software >> Testing >> Automation Testing >> Automation Testing AllOther
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions (495)
 Load Runner interview questions  Load Runner Interview Questions (486)
 QTP interview questions  QTP Interview Questions (3475)
 Test Director interview questions  Test Director Interview Questions (161)
 Rational TestSuite interview questions  Rational TestSuite Interview Questions (106)
 Silk Test interview questions  Silk Test Interview Questions (59)
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions (383)
Question
Write a query to find second highest salary of an employee.
 Question Submitted By :: Ravi
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Write a query to find second highest salary of an employee.
Answer
# 1
I write this query and it run !!

SELECT max(salary) FROM Employee WHERE Employee.salary <
(SELECT max(salary) FROM Employee)


Plz reply if anyone having generic answer. :-)

Thanks
 
Is This Answer Correct ?    300 Yes 56 No
Ravi
 
  Re: Write a query to find second highest salary of an employee.
Answer
# 2
SQL Server ( For 2nd max Salary )
---------------------------------

select Min(salary) from
( Select Top 2 salary from
( Select distint salary from Employee Order by
salary Desc ))


with this query we can find n th salary.

if am wrong plz correct me.
thx
 
Is This Answer Correct ?    52 Yes 95 No
Rajeshraajan
 
 
 
  Re: Write a query to find second highest salary of an employee.
Answer
# 3
select max(sal)from emp e1 where 2<=(select count(*) from
emp e2 where e1.sal <= e2.sal);
 
Is This Answer Correct ?    65 Yes 38 No
Vittal
 
  Re: Write a query to find second highest salary of an employee.
Answer
# 4
select * from emp A where 2=(select count(*) from emp B
where A.sal < B.sal)
 
Is This Answer Correct ?    41 Yes 36 No
Murlidhar
 
  Re: Write a query to find second highest salary of an employee.
Answer
# 5
Select * from emp e where 2=(select count(Distinct(esal))
from emp where e.esal<=emp.esal)
 
Is This Answer Correct ?    27 Yes 22 No
Lokesh Kanithi
 
  Re: Write a query to find second highest salary of an employee.
Answer
# 6
select sal from empa where 1=(select count of sal from emp
b)where a.sal<b.sal
 
Is This Answer Correct ?    9 Yes 25 No
Krishna
 
  Re: Write a query to find second highest salary of an employee.
Answer
# 7
Select * from epm A where &(n-1)=(select count(*) from emp
B where A.sal < B.sal);

Try this it will work,this will give nth salary ie if u
enter 2 this will give second highest sal
 
Is This Answer Correct ?    13 Yes 22 No
Muralidhara(minchu)
 
  Re: Write a query to find second highest salary of an employee.
Answer
# 8
select employee_name
from employee
order by salary desc
where ROWNUM=2
 
Is This Answer Correct ?    31 Yes 83 No
Lia
 
  Re: Write a query to find second highest salary of an employee.
Answer
# 9
Select max(salary) from emp where salary NOT IN (Select max
(salary) from emp)
 
Is This Answer Correct ?    93 Yes 14 No
Pradeep Kumar
 
  Re: Write a query to find second highest salary of an employee.
Answer
# 10
SELECT max(salary) as salary FROM Employee WHERE salary <
(SELECT max(salary) FROM Employee)
 
Is This Answer Correct ?    67 Yes 8 No
Dharmaraj
 

 
 
 
Other Automation Testing AllOther Interview Questions
 
  Question Asked @ Answers
 
What is the best scripting language for automation (function) testing   4
hi........ i want kniow about automation testing.how to work as automation tester.If we have a software so how to test the software from automation tool like QTP please give me answer in detail or any link thanks   1
I want online Training for selenium web driver. please can you send any details?   2
How to find that tools work well with your existing system?   2
We have a testing assignment should be test in very short span.Do you think automated tests are the best solution for this type of scenario?   3
what is meant by keyboard driven test?   3
What did you include in a test plan?   2
what is defferevce between QA and QC Tarang 3
define joins? when you will joins use? Mind-Tree 3
If a scenario is given and asked whether we can automate the system according to that scenario,how wil we answer such type of questions? TCS 1
What are the application does winrunner support? What are the applicaiotn does QTP support? Does winrunner, QTP can be used in Linux OS?   2
I am looking for selenium RC Training in Hyderabad. can any one tell me the best institute ?   53
 
For more Automation Testing AllOther Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com