早教吧 育儿知识 作业答案 考试题库 百科 知识分享

1.Giveaqueryforalistofeachdepartment(numberandname)withtheirnumberofemployees.这是EMP表的问题,2.giveaqueryforalistofeachdepartment(numberandname)foralldepartmentwithnoemployees.

题目详情
1.Give a query for a list of each department(number and name)with their number of employees.
这是EMP表的问题,2.give a query for a list of each department(number and name) for all department with no employees.
▼优质解答
答案和解析
select dep.dept_no,dep.name,count(emp.empno) employeeNumber
from ps_department dep,ps_employee emp
where dep.dept_no = emp.dept_no
and dep.current_status = 'Y' /* in use */
and emp.current_status = 'Y' /* in use */
fyi.