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
How to use like conditions in oracle?
How to select some rows from a table in oracle?
How to assign a table row to a record variable?
How to load data through external tables?
What is oracle used for?
What are the differences between char and nchar in oracle?
how to handle exceptions in post production
Will you be able to store pictures in the database?
What is a server parameter file in oracle?
What is dynamic proxy?
What is a lookup table in oracle?
what is dynamic SGA and static SGA
Explain the use of analyse option in exp command.
what are steps for interface? where is exchange rate defined in which table?
Explain the use of indexes option in exp command.