how to get the no employee in each department including the
dept which has 0 employee
Answers were Sorted based on User's Feedback
Answer / mahesh madala
select d.deptno,count(ename)no_of_emps from emp e,dept d
where d.deptno = e.deptno(+)
group by d.deptno
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / shailesh
select d.department_id,count(e.employee_id) from
departments d
left outer join employees e
on(e.department_id=d.department_id)
group by d.department_id;
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sanjay pradhan
select d.deptno,count(ename)employees from emp e,dept d
where d.deptno = e.deptno(+)
group by d.deptno
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sudipta santra
select distinct dept_no, nvl(count(emp_no),0) from dept
group by dept_no;
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / priti
select count(emp_id) from employee group by dept_id;
| Is This Answer Correct ? | 0 Yes | 3 No |
How to write text literals in oracle?
How do we display rows from the table without duplicates?
Explain enable novalidate constraint.
Other than making use of the statspack utility, what would you check when you are monitoring or running a health check on an Oracle 8i or 9i database?
What is enter substitution variable in oracle?
What is SQL access advisor in Oracle?
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
what is host string in sql plus? how does it related to database?
what is meant by magic query
How to select some rows from a table in oracle?
How do I connect to oracle database?
How do I manually uninstall oracle client?