Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain an exception and its types?

1134


What is the difference between Delete, Truncate and Drop in Oracle?

1183


What are the different oracle database objects?

1146


What to do if the binary spfile is wrong for the default instance?

1107


What is oracle instant client?

1067


Explain an integrity constrains?

1190


What is the usage of save points in oracle database?

1011


master table and child table performances and comparisons in Oracle ?

2194


What is a nested table?

1111


What are the ways tablespaces can be managed and how do they differ?

2443


What are joins, explain all types of joins?

2360


How to list all tables in your schema?

1114


How to do clean up if create database failed?

1067


How to start a new transaction in oracle?

1136


How do I use os authentication with weblogic jdriver for oracle and connection pools?

1095