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
How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?
Explain a data segment?
How to create a table in a specific tablespace?
Who developed oracle & when?
How to sort output in descending order in oracle?
How many data types are supported?
What are the restrictions on external table columns?
What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?
Is java required for oracle client?
How to declare a local variable?
What is the disadvantage of User defind function?
Is oracle an open source?
How to write a left outer join with the where clause in oracle?
How to import one table back from a dump file?
What is a proxy class?