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
Explain an exception and its types?
What is the difference between Delete, Truncate and Drop in Oracle?
What are the different oracle database objects?
What to do if the binary spfile is wrong for the default instance?
What is oracle instant client?
Explain an integrity constrains?
What is the usage of save points in oracle database?
master table and child table performances and comparisons in Oracle ?
What is a nested table?
What are the ways tablespaces can be managed and how do they differ?
What are joins, explain all types of joins?
How to list all tables in your schema?
How to do clean up if create database failed?
How to start a new transaction in oracle?
How do I use os authentication with weblogic jdriver for oracle and connection pools?