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 do we get field detail of a table?
What is the usage of control file in oracle?
How to create an initialization parameter file?
What is dynamic proxy?
How to run create database statement?
Explain the blob datatype?
What happens internally when the user types userID/password@string in SQL PLUS Thanks-Bhaskar
What is proxy method?
Compare and contrast between sql and sql server and explain its various functions?
What is the sid in oracle?
How does the on-delete-cascade statement work?
What is not equal to in oracle?
What is Redo Log Buffer in Oracle?
Can group functions be used in the order by clause in oracle?
How many types of database triggers exist?