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 |
Tell me New Feature of Oracle 10g?
Explain user account with reference to oracle.
Why required to run root.sh at the time of installation and what exactly it will do
what is a cartition product?
Can we create more than one constraint to column ?
What are a cluster and non-cluster index?
How to view the dropped tables in your recycle bin?
What are inner join and outer join?
Do View contain Data ?
24. Display the order number for all orders whose average item cost is greater than the overall average item cost across all orders.
what is the syntax of DELETE command?
What is the string concatenation operator in oracle?