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 are the different oracle database objects?
emp numb is unique because that is primary key,,but what is foreign key .. explain very clear with example
What are the roles of dba?
What is the function of Redo Log ?
How to create id with auto_increment on oracle?
Hi how Can I Add A Foreign key that references a table that has composit primary key ? example i had costumer table that has C_Id and SSN Both as PK and another table has C_Id that must refernece C_Id in Customers i done the usual way and got oracle error message about uniqeness any ideas plz
What is difference between truncate and delete?
Please explain me all types of Data models. Also give me the details if each model can have other name.for example:schematic data model is also known as conceptual data model and entity relation data model.
What is the maximum number of CHECK constraints that can be defined on a column ?
when loggined as SYSTEM,how to display all the users of database using sql query?
What is an oracle database?
What is bind variable in oracle 11g?