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
What is an oracle data file?
What is a cognitive schema?
Explain a synonym?
What privilege is needed for a user to insert rows to tables in another schema?
Can we convert a date to char in oracle and if so, what would be the syntax?
How to write date and time literals in oracle?
How do I know if oracle is installed on windows?
What is a subquery?
What is a procedure in oracle?
What are the benefits of ordbms?
How do I start tns listener?
What are the various types of snapshots ?
What are temporal data types in oracle?
Which dictionary view(s) would you first look at to understand or get a high-level idea of a given Advanced Replication environment?
What is the difference between hot backup and cold backup in oracle?