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
How to view existing locks on the database?
material view and view disadvantages?
How to write a query with an inner join in oracle?
What are the general rules on data consistency?
Explain mutating triggers.
What is the scope of a local variable?
What is truncate oracle?
What is using clause and give example?
Why is oracle so popular?
How to select some rows from a table in oracle?
What do you mean by merge in oracle?
How to call a stored function in oracle?
What is a table index in oracle?
How does Oracle guarantee data integrity of data changes?
How to select all columns of all rows from a table in oracle?