Given two table employee and department
EMP
----------------
empid deptid(fk)
Dept
---------------------
deptid(pk) deptname
que-Write a query to find count of employee in each
department.
Expected Output-
deptid countofEmployee
---------------------------
10 57
20 20
30 15
Answer Posted / anithaletchumi
select d.deptid,count(e.empid) as countofEmployee from
department d left outer join employee e on
d.deptid=e.deptid group by d.deptid
Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
various types of hints and their usage
How many categories of data types?
How to rename an index in oracle?
How to start a new transaction in oracle?
what is the difference between functional dependecy and multilevel dependency?
How to get a list of all background sessions in the database?
How to rename an index?
How to create a new view in oracle?
How to assign values to variables?
How to assign query results to variables?
Can you tell me how to add new column in existing views?how?How is possible?
What do you mean by merge in oracle and how can you merge two tables?
What do you understand by a database object? Can you list a few of them?
What are the differences between primary key and unique key?
How to rename an existing table?