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 |
What is a SNAPSHOT ?
Does oracle database need java?
1. Display all the rows and columns in the CLIENT table. Sort by client name in reverse alphabetical order.
I just want to maintain data like an employee can belongs to 3 or more departments . We can resolve this by using composite key but it avoids normalization rules. So Can anyone tell me how can I maintain data.
What is the difference between view and materialized view in Oracle?
How to export data to a csv file?
What is raw datatype?
Give the various rollback segment states.
There are n numbers of flatfile of exactly same format are placed in a folder.Can we load these flatfile's data one by one to a single relational table by a single session??
How to Identify the previously inserted/updated records in already populated table.
How to drop a stored procedure in oracle?
2. Display the post code and the total number of purchase orders placed with creditors in that post code.