Which Department has MOST NUMBER of employees?

Answer Posted / shibashis

Select d.deptname,count(*) as cnt
from employee e inner join dept d
On e.deptid=d.deptid
group by d.deptname
having cnt in (
select max(cnt) from
(SELECT deptid ,count(*) as cnt FROM employee GROUP BY deptid )
)
order by d.deptname
;

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does oracle database need java?

512


22. Display the order number, number of lines in the order, total number of items and total value for all orders that have a total value greater than $100

1594


Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).

1799


What are the parameters that we can pass through a stored procedure?

544


Explain an exception?

559






What is index in Oracle?

581


Is oracle the best database?

509


What is oracle database 10g express edition?

584


How to create a testing table in oracle?

534


i have a question here... As of my knowledge, when we apply an index (b-tree)on a column, internally it arranges the data in b-tree format and do the fetching process correspondingly... and my quetion is... How a bit-map index arranges the data internally when applied on a column?IS it in b-tree format or whatelse?

1460


Difference between varchar and varchar2 data types?

652


How to use select statement to count the number of rows in oracle?

543


What is recovery manager in Oracle?

581


How can I create database in oracle?

557


What is the difference between a hot backup and a cold backup in oracle?

563