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  >>  Oracle  >>  Oracle General
 
 


 

 
 Oracle General interview questions  Oracle General Interview Questions
 OCI interview questions  OCI Interview Questions
 Architecture interview questions  Architecture Interview Questions
 Oracle Security interview questions  Oracle Security Interview Questions
 Database Management interview questions  Database Management Interview Questions
 Forms Reports interview questions  Forms Reports Interview Questions
 Oracle AllOther interview questions  Oracle AllOther Interview Questions
Question
Anybody can tell me, how do we find second largest emp
salary from emp table.. Thanks in advance ...
 Question Submitted By :: Laxmi
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Anybody can tell me, how do we find second largest emp salary from emp table.. Thanks in advance ...
Answer
# 1
select max(sal) from emp where sal < (select max(sal) from 
emp)
 
Is This Answer Correct ?    5 Yes 0 No
Raj
 
  Re: Anybody can tell me, how do we find second largest emp salary from emp table.. Thanks in advance ...
Answer
# 2
select e.sal from emp e where &2>(select max(count{a.sal})
from emp a where a.sal > e.sal order by desc
)
 
Is This Answer Correct ?    0 Yes 0 No
Martin
 
 
 
  Re: Anybody can tell me, how do we find second largest emp salary from emp table.. Thanks in advance ...
Answer
# 3
I would say that Raj has given the correct answer in general.

In most cases the interviewer restricts the parameter to be
written in the query as it might effect the performance.
 
Is This Answer Correct ?    1 Yes 0 No
Mahaboob
 
  Re: Anybody can tell me, how do we find second largest emp salary from emp table.. Thanks in advance ...
Answer
# 4
Select TOP 1 salary from (select Distinct TOP 2 salary from 
employee orderby salary desc)
 
Is This Answer Correct ?    0 Yes 1 No
Amitkumar
 
  Re: Anybody can tell me, how do we find second largest emp salary from emp table.. Thanks in advance ...
Answer
# 5
Oracle 10g Using : Find 2nd Highest Salary?

SELECT * FROM emp e WHERE 2=(SELECT COUNT(DISTINCT salary)
FROM emp x
WHERE x.salary >= e.salary);

Answer :

   EMP_NO EMP_NAME                     SALARY   
--------- ------------------------- --------- 
      107 SARABOOT                     550000
 
Is This Answer Correct ?    1 Yes 0 No
Selvaraj Anna University Coe
 
  Re: Anybody can tell me, how do we find second largest emp salary from emp table.. Thanks in advance ...
Answer
# 6
Dear 
here i am sending new ans u can give the value in parameter

 SELECT SAL,NO FROM(
SELECT  SAL ,ROWNUM NO FROM 
(SELECT DISTINCT SAL FROM EMP ORDER BY SAL DESC)) WHERE NO=:N


Regards,

Samad
 
Is This Answer Correct ?    0 Yes 1 No
Samad
 

 
 
 
Other Oracle General Interview Questions
 
  Question Asked @ Answers
 
various types of joins  2
what is the output of select * from emp where null=null & select * from emp where 1=1  5
What is a Sequence ?  1
What is an Index Segment ?  1
What is the difference between implicit index and explicit index? TCS1
What is Row Chaining ?  1
what are pseudocolumns?  4
What is meant by recursive hints ?  1
What is a Private Synonyms ?  1
What is an Extent ?  2
What are the composite date types in oracle?  2
What is a heap related to database ? TCS1
What are the type of Synonyms?  1
How to make a Data Backup in oracle ? What is the procedure for creating the dump files in oracle ( any version ) ? Satyam1
What is Public Database Link ?  1
what is Table ?  1
what are the database links ?  1
Will the Optimizer always use COST-based approach if OPTIMIZER_MODE is set to "Cost"?  1
What is COST-based approach to optimization ?  4
Maximum how many triggers can be updated in table ? Accenture4
 
For more Oracle General 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