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
What is the difference between primary key and unique key and foreign key in oracle?
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.
what are actual and formal parameters?
How to connect to a remote server?
you are a universe designer and report developer in BO, what type of information you gather from client?Briefly explain plz
What is the simplest tool to run commands on oracle servers?
How to write an inner join with the where clause in oracle?
What are the differences between char and varchar2 in oracle?
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
What privilege is needed for a user to create tables in oracle?
Explain the use of consistent option in exp command.
What is the difference between Delete, Truncate and Drop in Oracle?
Explain an index segment?
What is a cursor in oracle?
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?