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

How to view existing locks on the database?

1030


material view and view disadvantages?

1047


How to write a query with an inner join in oracle?

1015


What are the general rules on data consistency?

988


Explain mutating triggers.

1006


What is the scope of a local variable?

1043


What is truncate oracle?

957


What is using clause and give example?

1014


Why is oracle so popular?

971


How to select some rows from a table in oracle?

1052


What do you mean by merge in oracle?

977


How to call a stored function in oracle?

1004


What is a table index in oracle?

1105


How does Oracle guarantee data integrity of data changes?

2369


How to select all columns of all rows from a table in oracle?

1037