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 (3474)
 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 (382)
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
 
How can u enter text in one particular text box? if one webpage contain multiple text boxes, all text boxes with same properties there in no index and Location properties   2
in VSS, what is meant by check out and check in? Vmoksha 8
i want to pass parameters with some values in the same test. How to call the parameters in the test and to associate it Airtel 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
what is the command for identifing the color of the object. please help me ? my numberis 9916800532 TCS 2
Describe some problem that you had with automating test tool?   1
If testing is done using white box testing,then what is the need of using Black box testing again? I mean when unit testing and Integration testing is done at Coding level, what is the need of testing again at testing level?   1
WHAT WE CAN NOT DO WITH QTP? GIVE 5 POINTS.(EXCEPT PERFOMANCE) Leo-Technologies 1
Why we use Junit and Jmeter? Suggest some sites where we can get more information on these two Tools?   2
What automated tools are you familiar with?   1
hi Friends this is Srinivas. Can u discribe about bug lifecycle.how to say in interview.send me my mail :dsrao106@gmail.com Wipro 5
What automating testing tools are you familiar with?   2
 
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