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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
Why does for update in oracle 8 cause an ora-01002 error?
can anyone help me ? an index has been done on the primary key of a table. an update operation was performed on that table. now my question is 1> what abt the performance ? means faster or slower due to indexing ? 2> does the operation affect to the primary key constraint ?
How to install oracle database 10g xe?
Can Multiple instances be run on Single Machine???
Differentiate between pre-select and pre-query?
What is merge in oracle?
What are the tools for Oracle ?
I have table-A(1,2,3,4,4,5,6,6,6,7). how to get all duplicate values?what is sql query?
What is Database Buffers ?
Explain an exception?
What is Private Database Link ?
24. Display the order number for all orders whose average item cost is greater than the overall average item cost across all orders.