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 is the file extension for sql database?

0 Answers  


What is a join?Explain the different types of joins?

6 Answers   Bank Of India, CitiGroup, Google, ICICI, Saama Tech, SkyTech, TCS,


How do u count no of rows in a table?

8 Answers   CTS,


What are different types of sql?

0 Answers  


What is sqlservr exe?

0 Answers  






What found sql?

0 Answers  


What is replication id?

0 Answers  


Explain the structure of pl/sql in brief.

0 Answers  


what is difference between stored procedures and application procedures,stored function and application function?

1 Answers  


how can I make a script that can be bi-language (supports english, german)? : Sql dba

0 Answers  


what is sql server agent? : Sql dba

0 Answers  


What is the difference between explicit and implicit cursors in oracle?

0 Answers  


Categories