There is 2 namely emp, dept emp contains empid,ename,deptno dept contains depid,deptno deptno is primary and deptno in emp is foreign keyMy question is no of employees working in particular department . The display should show departname and no of employees in particular department.Please answer to my email id

Showing Answers 1 - 3 of 3 Answers

Laxmi Prasanna.Nedunuri

  • Jan 27th, 2006
 

select dept.depid, count(emp.empid) from dept, emp where dept.deptno = emp.deptno group by dept.deptid

considering depid is department .

  Was this answer useful?  Yes

madhu

  • Feb 23rd, 2006
 

the query is

select d.dname,count(*)

from emp e, dept d

where e.deptno = d.deptno

group by d.dname

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions