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 do we get field detail of a table?

1078


What is the usage of control file in oracle?

1085


How to create an initialization parameter file?

1049


What is dynamic proxy?

1005


How to run create database statement?

1032


Explain the blob datatype?

1071


What happens internally when the user types userID/password@string in SQL PLUS Thanks-Bhaskar

4585


What is proxy method?

971


Compare and contrast between sql and sql server and explain its various functions?

963


What is the sid in oracle?

963


How does the on-delete-cascade statement work?

1103


What is not equal to in oracle?

1001


What is Redo Log Buffer in Oracle?

1207


Can group functions be used in the order by clause in oracle?

997


How many types of database triggers exist?

1133