how to get the no employee in each department including the
dept which has 0 employee

Answers were Sorted based on User's Feedback



how to get the no employee in each department including the dept which has 0 employee..

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

how to get the no employee in each department including the dept which has 0 employee..

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

how to get the no employee in each department including the dept which has 0 employee..

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

how to get the no employee in each department including the dept which has 0 employee..

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

how to get the no employee in each department including the dept which has 0 employee..

Answer / priti

select count(emp_id) from employee group by dept_id;

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Oracle General Interview Questions

What are the different oracle database objects?

0 Answers  


emp numb is unique because that is primary key,,but what is foreign key .. explain very clear with example

1 Answers  


What are the roles of dba?

0 Answers  


What is the function of Redo Log ?

1 Answers  


How to create id with auto_increment on oracle?

0 Answers  






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

2 Answers  


What is difference between truncate and delete?

0 Answers  


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.

0 Answers  


What is the maximum number of CHECK constraints that can be defined on a column ?

3 Answers  


when loggined as SYSTEM,how to display all the users of database using sql query?

2 Answers  


What is an oracle database?

0 Answers  


What is bind variable in oracle 11g?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)