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 to view the tablespaces in the current database?

961


What are the advantages of oracle?

1012


Explain alias?

1109


What is Reduced List of Values?

2148


How to load data from external tables to regular tables?

1041


Can we use bind variables in oracle stored procedure?

934


Using the relations and the rules set out in the notes under each relation, write statements to create the two sequence generators specified in the notes.

2090


What are joins, explain all types of joins?

2270


 What are the oracle DML commands possible through an update strategy?

1042


Use of an integrity constraint is better to validate data. Explain

1023


What is redo log?

1042


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

972


What are the data types in oracle?

1019


What do you mean by group by clause?

1025


How to display employee records who gets more salary than the average salary in the department?

1039