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 / sonal

select * from (select ename, deptno,sal
from emp where deptno in(10 , 20)
order by sal desc)
where rownum < =1

Is This Answer Correct ?    2 Yes 4 No

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

Answer / partha

Select emplid, sal from (select emplid, sal from
emp_sal_tbl where deptid = 10 order by sal desc) a where
rownum < 2
union
Select emplid, sal from (select emplid, sal from
emp_sal_tbl where deptid = 20 order by sal desc) a where
rownum < 2

Is This Answer Correct ?    0 Yes 4 No

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

Answer / sumesh s.g

select Name from TBL_Employee
where Salary in(
select max(Salary) from dbo.TBL_Employee
group by DepID
having DepID in(10,20))


--Happy Codding--

Is This Answer Correct ?    0 Yes 5 No

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

Answer / nancy

Select ename from table where dept_no in ('10','20') group
by dpt_no

Is This Answer Correct ?    4 Yes 27 No

Post New Answer

More SQL PLSQL Interview Questions

what are sequences

0 Answers  


What is a primary key called that is made up of more than one field?

0 Answers  


What is a temporal data type?

0 Answers  


which tcp/ip port does sql server run on? : Sql dba

0 Answers  


What is time based sql injection?

0 Answers  






What are the advantages of stored procedure?

0 Answers  


How long does it take to learn pl sql?

0 Answers  


how many triggers are allowed in mysql table? : Sql dba

0 Answers  


How to call shell script from pl sql procedure?

0 Answers  


What is difference between stored procedure and trigger?

0 Answers  


what is the order of pre-defined exceptions.

6 Answers   TCS,


Where do we use pl sql?

0 Answers  


Categories