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 / ajit

select d.deptno, count(e.deptno) total
from emp e, dept d
where e.deptno(+) = d.deptno
group by d.deptno;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you go about verifying the network name that the local_listener is currently using?

2110


How to enter a new row into a table interactively?

1053


How to specify default values in insert statement using oracle?

1155


How does oracle handle read consistency?

1153


What is a relational database management system?

1173


Explain the use of grant option in exp command.

1112


Can the query output be sorted by multiple columns in oracle?

1061


What is Trigger in Oracle?

1244


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

1047


How to add a new column to an existing table with a default value?

1057


How to commit the current transaction in oracle?

1188


Does oracle charge for java?

1115


Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.

2057


How to Truncate Table in Oracle

1216


How to use "in out" parameter properly?

1105