求解oracle习题.10.Write a query to display the department name,l

求解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
吹歌新人 1年前 已收到1个回答 举报

tennise1 幼苗

共回答了16个问题采纳率:93.8% 举报

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 ;
大概是这样了

1年前

5
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 1.069 s. - webmaster@yulucn.com