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 the difference between primary key and unique key and foreign key in oracle?

554


HI Friends Myself Manoj,i am from bengaluru.i have 1 yr of exp in PLSQL but not upto the mark..now attending interviews but m not able to clear even 1 round..i have attended 3 interviews till today.purpose of writing this query is,i want to know the intreview topics that interviewer going to ask frequently,mainly SCENARIO based questions.IF anybody have any PLSQL projects please give it to me,it will helps me alot.Thanks for your patience.

997


what are actual and formal parameters?

596


How to connect to a remote server?

562


you are a universe designer and report developer in BO, what type of information you gather from client?Briefly explain plz

1564






What is the simplest tool to run commands on oracle servers?

520


How to write an inner join with the where clause in oracle?

584


What are the differences between char and varchar2 in oracle?

565


Iam learning oracle developer 2000.. can anyone give me then tutorials sites or PDF related to developer 2000 please send me the details @ mak2786@gmail.com thanks Arun

1666


What privilege is needed for a user to create tables in oracle?

550


Explain the use of consistent option in exp command.

552


What is the difference between Delete, Truncate and Drop in Oracle?

606


Explain an index segment?

645


What is a cursor in oracle?

652


If youre unsure in which script a sys or system-owned object is created, but you know its in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?

1661