求解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

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/29 07:22:34
求解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
xRJ@~JLҊX !c*"ɴ6&&= z='ы"Z-L7havonBa,Ϛ*J 2R=HQ">AHUOcLʼngq6P,%P3K ; 2uB2 8LG,L[4;,ytt ᧱}m E zgm:6l((*^ t=|>853/xC,nx*x.50sY]Ј;V^u-*0W^oںm6 JUJ^iB,@h9 DI2w0E0ZD<IGpiOLw(Ih~zpܼ>kD"?;/

求解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
求解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

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