Which Department has MOST NUMBER of employees?

Answer Posted / mady

In SQL Server / MS Access:
==========================
select top 1 department_name
from EMPLOYEES
join DEPARTMENTS
on EMPLOYEES.department_id=DEPARTMENTS.department_id
group by department_name
order by count(*) desc;

In My SQL:
============
select department_name
from EMPLOYEES
join DEPARTMENTS
on EMPLOYEES.department_id=DEPARTMENTS.department_id
group by department_name
order by count(*) desc
limit 1;

Is This Answer Correct ?    24 Yes 29 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Undo Management Advisor in Oracle?

601


What to do if dba lost the system password?

587


ABOUT IDENTITY?

1549


Is it possible to split the print reviewer into more than one region ?

1824


How to use existing values in update statements using oracle?

538






What is the usage of merge statement?

663


what is the use of system.effective.date variable in oracle?

661


How to concatenate two text values in oracle?

587


Can you tell me how to add new column in existing views?how?How is possible?

921


How to use null as conditions in oracle?

572


How to define a data source name (dsn) in odbc manager?

517


What are the oracle differences between nvl and coalesce

500


List out the difference between commit, rollback, and savepoint?

608


Explain what are the advantages of views?

601


Why do you use stored procedures and state some of its disadvantages?

554