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
hi friends i completed b.com 2004.i have 3y accounting exp. in manufacturing company.now i have completed oracle finance.pls suggest me how will get job in oracle.can i get job in oracle.
How to define a data source name (dsn) in odbc manager?
List out the difference between commit, rollback, and savepoint?
What is MTTR advisor in Oracle?
What suggestions do you have to reduce the network traffic?
How to get a list of all background sessions in the database?
What is a sub query? Describe its types?
What is the sid in oracle?
What is the difference between sharding and partitioning?
What is recovery manager(rman) backup in Oracle?
What are the differences between number and binary_float in oracle?
How to find out what oracle odbc drivers are installed?
How to divide query output into groups in oracle?
What do you understand by database schema and what does it hold?
How to drop a stored function?