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

What is PL/SQL ?

1897


How to define a specific record type?

1034


What are data pump export and import modes?

1014


How a tablespace is related to data files?

1057


Is oracle a relational database?

870


Please explain compound trigger in oracle?

992


defination of bitmap index

2043


What is key preserved table?

954


what are the default admin accounts in Oracle 10g ?

916


Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.

2040


what is the difference between data migration and production migration.

2272


You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?

1935


How to start a specific oracle instance?

987


How to do clean up if create database failed?

972


How to use attributes of the implicit cursor in oracle?

946