From an Employee table, how will you display the record
which has a maximum salary?

Answers were Sorted based on User's Feedback



From an Employee table, how will you display the record which has a maximum salary?..

Answer / debjani chakraborty

Select * from Employee where salary in(select max(salary)
from Employee);

Is This Answer Correct ?    58 Yes 2 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / kavitha nedigunta

select * from emp e,(select max(sal) sal
from emp)a
where e.sal= a.sal;


select * from emp
where sal in(select max(sal) from
emp);

Is This Answer Correct ?    29 Yes 3 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / pradeep sahoo

Select * from Employee where sal = (select max(sal) frpm
Employee)

Is This Answer Correct ?    25 Yes 1 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / sharmila

Select * from Employee where salary in(select max(salary)
from Employee)

Is This Answer Correct ?    13 Yes 1 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / aruna parulekar

select * from employee where sal=(select max(sal) from
employee);

Is This Answer Correct ?    14 Yes 2 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / sharmila

select emp_name,max(salary)
from Employee.

Is This Answer Correct ?    55 Yes 44 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / kvsd

select * from employees where salary = (select max(salary)
from employees)

Is This Answer Correct ?    5 Yes 1 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / sayed

select top(1) * from emp order by salary desc

Is This Answer Correct ?    4 Yes 1 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / os reddy

select * from emp
where sal=(select max(sal) from emp);

OR

select * from emp
where sal in(select max(sal) from emp);

Is This Answer Correct ?    4 Yes 1 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / pradeep

To get nth rank salary or max salary two ways

below 5th

select ct , empno, sal from (SELECT max(rownum) ct , empno,
sal FROM emp group by empno, sal ORDER BY sal desc) where
ct =5;

below 2nd

select * from (
SELECT DEPTNO,ENAME,SAL,COMM,
RANK() OVER ( ORDER BY SAL DESC, COMM) poK from emp)
where pok =2;

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

source destination distance chennai bangalore 500 bangalore chennai 500 hyd delhi 1000 delhi hyd 1000 bangalore hyd 800 Here chennai to bangalore and bangalore to chennai is same distance. and hyd and delhi also same criteria. Based on the distance i want to display only one row using sql query?

4 Answers   JPMorgan Chase,


declare lowerl number:= 1; upperl number:= 3; num varchar2(10); begin for i into lowerl..upperl loop num:=num||to_char(lowerl); if i=3 then upperl:=5; end loop; message(num); What will be the output ?

3 Answers   Oracle,


What are the advantages of normalization?

0 Answers  


What is the difference between the conventional and direct path loads? : aql loader

0 Answers  


Can a table contain multiple primary key’s?

0 Answers  






Why is nosql good?

0 Answers  


How do I order columns in sql?

0 Answers  


Can we create table inside stored procedure?

0 Answers  


What is function and procedure in pl sql?

0 Answers  


What is a mutating table and a constraining table?

0 Answers  


What does “select count(1) from tab” result?

10 Answers   IBM,


Define implicit and explicit cursors.

0 Answers  


Categories