早教吧作业答案频道 -->英语-->
sql笔试题有两个表第一个TableStoreStore-id(PK)CitySpacewh1NewYork370wh2Beijing500wh3NewYork200wh4London400……这是第一个表TableEmployee(EmployeeInStore)Store-id(FK)Emp-ID(PK)SalaryWH1e1
题目详情
sql笔试题
有两个表
第一个
Table Store
Store-id(PK) City Space
wh1 New York 370
wh2 Beijing 500
wh3 New York 200
wh4 London 400
……
这是第一个表
Table Employee(Employee In Store) Store-id(FK) Emp-ID(PK) Salary WH1 e1 1220 wh1 e3 1210 wh2 e4 1250 WH2 e6 1230 …… 第二个表
1Get the average salary of each store
2Get the average salary of each city
3find cities in which there exists salary less than 1000
4Get the average salary of cities there exists salary less than 1000(can create temporary tables)
5Get the employees who are paid the max salary for each city.( can create temporary tables)
6Get the total salary the total space ,the number of the store ,the number of the employee and maximum salary of every city.Show the results as following layout.( can create temporary table)
有两个表
第一个
Table Store
Store-id(PK) City Space
wh1 New York 370
wh2 Beijing 500
wh3 New York 200
wh4 London 400
……
这是第一个表
Table Employee(Employee In Store) Store-id(FK) Emp-ID(PK) Salary WH1 e1 1220 wh1 e3 1210 wh2 e4 1250 WH2 e6 1230 …… 第二个表
1Get the average salary of each store
2Get the average salary of each city
3find cities in which there exists salary less than 1000
4Get the average salary of cities there exists salary less than 1000(can create temporary tables)
5Get the employees who are paid the max salary for each city.( can create temporary tables)
6Get the total salary the total space ,the number of the store ,the number of the employee and maximum salary of every city.Show the results as following layout.( can create temporary table)
▼优质解答
答案和解析
两个表第一个store(store_id,city,space)
第二个employee(store_id,emp_id,salary)
1、每家店的平均工资
\x09select t1.store_id,AVG(salary) from store t1 inner join employee t2 on t1.store_id=t2.store_di
group by t1.store_id
2、每个城市的平均工资
select t1.city,AVG(salary) from store t1 inner join employee t2 on t1.store_id=t2.store_di
group by t1.city
3、查找该城市存在员工工资低于1000的城市信息
select distinct t1.city
from store t1 inner join employee t2 on t1.store_id=t2.store_id
where t2.salary
第二个employee(store_id,emp_id,salary)
1、每家店的平均工资
\x09select t1.store_id,AVG(salary) from store t1 inner join employee t2 on t1.store_id=t2.store_di
group by t1.store_id
2、每个城市的平均工资
select t1.city,AVG(salary) from store t1 inner join employee t2 on t1.store_id=t2.store_di
group by t1.city
3、查找该城市存在员工工资低于1000的城市信息
select distinct t1.city
from store t1 inner join employee t2 on t1.store_id=t2.store_id
where t2.salary
看了 sql笔试题有两个表第一个T...的网友还看了以下:
P.E is a short for ( )A science B busy C music D 2020-05-14 …
考查文法:G(VT,VN,E,P) 其中,VT={+,*,(,),i},VN={E,T,F},E为开 2020-05-26 …
条件概率问题P(E|F)=P(EF)/P(F)这个是如何从最原始的公式推导出来的?另外P(EF)我 2020-07-09 …
关于概率中容斥原理的疑问关于概率的几个命题,由于初学有些地方不太理解,请指教:1)P(EUF)=P 2020-07-24 …
设g(x)=px-q/x-2f(x),其中f(x)=lnx,且g(e)=qe-p/e-2.(e为自 2020-08-02 …
请问英文人名后的P.E.,DEE中的DEE是什么意思?请问英文人名后的P.E.,如JOSEPHA.S 2020-11-05 …
二阶微分方程求解题目2xy''=y'令p=y',则y''=p'=>2xp'=p=>2*dp/p=dx 2020-11-16 …
已知文法G:(1)E→E+T|T(2)T→T*F|F(3)F→P↑F|P(4)P→(E)|i1.已知 2020-12-07 …
谢谢你说的那个方法,我还想问问,就是在形成唯一的id目标是达到了,但是如果把id=10那一行的信息删 2020-12-31 …
英文单词分类填空动物类1.O()t()p()s2.k()t()e()3.l()b()t()r4.a( 2021-02-05 …