consider a table which contain 4 columns,ename,eno,sal and
deptno, from this table i want to know ename who having
maximum salary in deptno 10 and 20.

Answers were Sorted based on User's Feedback



consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ..

Answer / avinash

select ename from emp where sal in(select max(sal) from
emp) and deptno in(10,20)

Is This Answer Correct ?    0 Yes 0 No

consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ..

Answer / sanjeev

SELECT ENAME FROM TABLE NAME WHERE SAL>(SELECT MAX(SAL)
FROM TABLE NAME GROUP BY DEPTNO

Is This Answer Correct ?    0 Yes 0 No

consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ..

Answer / praveen reddy.eddula

select ename from emp where sal in(select max(sal) from emp
where deptno in(10,20))

Is This Answer Correct ?    0 Yes 0 No

consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ..

Answer / swati pise

select top 1 * from table where dept_no in(10,20) order by
sal desc

Is This Answer Correct ?    0 Yes 0 No

consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ..

Answer / swati

select top 1 ename from emp where deptno in(10,20) order by
sal desc

Is This Answer Correct ?    0 Yes 0 No

consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ..

Answer / lipika

Select Ename From emp where sal in (Select Max(Sal) From
emp where deptno in (10,20) group by deptno);

Is This Answer Correct ?    0 Yes 0 No

consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ..

Answer / john

select dept_id,ename max(sal) from employee where dept_id
in ('1','2') group by dept_id;

Is This Answer Correct ?    0 Yes 0 No

consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ..

Answer / pratdeor

Select ename from table where sal IN
(select Max(sal) over (partition by Deptno) as mxs from table) and Deptno IN (10,20);

Is This Answer Correct ?    0 Yes 0 No

consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ..

Answer / gautam

select ename,sal from emp
where sal in (select max(sal) from emp group by deptno)
and deptno in (10,20)

Gautam

Is This Answer Correct ?    3 Yes 4 No

consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ..

Answer / sp

select top 2 ename, salary, dept from dbo.employee where
dept in(10,20) order by salary desc

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

need to split a string into seperate values. eg. col1 col2 ---------- 100 - 'a,b,c' 200 - 'a,x,b,d,e' 300 - 'c' result: value count ------------- a - 2 b - 1 c - 2 etc.

1 Answers  


explain the difference between bool, tinyint and bit. : Sql dba

0 Answers  


How to retrieve a second highest salary from a table? Note:Suppose salaries are in duplicate values eg: Name Sal Malli 60000 Pandi 60000 Rudra 45000 Ravi 45000

10 Answers   Mind Tree, Polaris, Sonata,


When are we going to use truncate and delete?

0 Answers  


What is an Integrity Constraint?

4 Answers  






Why should I use postgresql?

0 Answers  


Define concurrency control. : Transact sql

0 Answers  


IF i write before / after insert / update trigger and i do rollback what will happen?

5 Answers   KPIT,


write a query find which rows of a table is updated on 2 days before?

3 Answers   TCS,


hello..... i am an comp science engineering graduate planning to do ORACLE certification in PLSQL 9i. just wanted to know whats the possibility getting job is their openings???? is it worth doin that course n certification

1 Answers  


How do I run a sql query in pgadmin 4?

0 Answers  


What is schema in sql?

0 Answers  


Categories