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 (496)
 Load Runner interview questions  Load Runner Interview Questions (486)
 QTP interview questions  QTP Interview Questions (3495)
 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 (385)
Question
Write a query to find second highest salary of an employee.
 Question Submitted By :: Automation-Testing-AllOther
I also faced this Question!!     Answer Posted By  
 
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 ?    301 Yes 56 No
Ravi
 
Answer
# 2
Select max(salary) from emp where salary NOT IN (Select max
(salary) from emp)
 
Is This Answer Correct ?    93 Yes 14 No
Pradeep Kumar
 
 
 
Answer
# 3
SELECT max(salary) as salary FROM Employee WHERE salary <
(SELECT max(salary) FROM Employee)
 
Is This Answer Correct ?    67 Yes 8 No
Dharmaraj
 
Answer
# 4
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
 
Answer
# 5
Select max(salary) from employee where salary NOT IN
(Select max(salary) from employee)
 
Is This Answer Correct ?    12 Yes 1 No
Upali Tejale
 
Answer
# 6
select *from emp e1 where &n =(select count(*) from emp
where sal >= e1.sal);
 
Is This Answer Correct ?    13 Yes 3 No
Sweety Spear
 
Answer
# 7
select First_Name,Salary from employees where salary in
( select max(salary) from employees
where salary < ( select max(salary) from employees) ),
 
Is This Answer Correct ?    10 Yes 0 No
Priyanshu
 
Answer
# 8
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
 
Answer
# 9
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
 
Answer
# 10
select sal from
(select rank() OVER (order by sal desc) sno ,sal from emp)
y
where sno= n

here
y : is the alias name for (select rank() OVER (order by sal
desc) sno ,sal from emp)
n : is the number ie if u want second highest sal then 'n'
value will be 2. for third highest n= 3...
 
Is This Answer Correct ?    7 Yes 2 No
Rajkumar Mandala
 

 
 
 
Other Automation Testing AllOther Interview Questions
 
  Question Asked @ Answers
 
What is use of writing Test cases Ordain-Solutions 2
I want online Training for selenium web driver. please can you send any details?   2
how to read data from a csv file using Test complete functional tool..please can anyone post the code   5
I am using the selenium ide for testing my web application i recorded some script and played back while playing the recorded script the "alert msg is not getting closed" it needs manual interaction Please help out me TCS 5
How do you Test Credit Card Validation V2-Solutions 2
Does automation replace manual testing?   2
why we are moving to QTP instead of using winrunner? Does QTP support any other applications which Winrunner cannot support?   1
What are the main benefits of test automation?   2
What are the types of testing we cannot do, by using automation tools Oracle 3
Does automation replace manual testing?   2
WHAT IS THE ARCHITECTURE OF QTP? IS THE ARCHITECTURE AND FRAMEWORK BOTH ARE SAME? Leo-Technologies 1
What criteria do you use when determining when to automate a test or leave it manual?   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