求解oracle习题.
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/08/01 03:52:46
求解oracle习题.
10.Write a query to display the department name,location name,number of employees,and the average salary for all employees in that department.Label the columns’ dname,loc,Number of People,and Salary,respectively.
DNAME LOC Number of People Salary
------------ --------- ---------------- --------
ACCOUNTING NEW YORK 3 2916.67
RESEARCH DALLAS 5 2175
SALES CHICAGO 6 1566.67
10.Write a query to display the department name,location name,number of employees,and the average salary for all employees in that department.Label the columns’ dname,loc,Number of People,and Salary,respectively.
DNAME LOC Number of People Salary
------------ --------- ---------------- --------
ACCOUNTING NEW YORK 3 2916.67
RESEARCH DALLAS 5 2175
SALES CHICAGO 6 1566.67
![求解oracle习题.](/uploads/image/z/16124826-66-6.jpg?t=%E6%B1%82%E8%A7%A3oracle%E4%B9%A0%E9%A2%98.)
select d.dname,d.loc,count(e.*) as "Number of People",avg(e.salary) salary
from department d, employees e
where d.dno=e.dno
group by d.dname,d.loc ;
大概是这样了
from department d, employees e
where d.dno=e.dno
group by d.dname,d.loc ;
大概是这样了