求计算机考试试题。!

求计算机考试试题。!,第1张

两个表第一个store(store_id,city,space)

第二个employee(store_id,emp_id,salary)

1、每家店的平均工资

select t1store_id,AVG(salary) from store t1 inner join employee t2 on t1store_id=t2store_di

group by t1store_id

2、每个城市的平均工资

select t1city,AVG(salary) from store t1 inner join employee t2 on t1store_id=t2store_di

group by t1city

3、查找该城市存在员工工资低于1000的城市信息

select distinct t1city

from store t1 inner join employee t2 on t1store_id=t2store_id

where t2salary<1000

4、查找城市其职工工资有低于1000的该城市职工平均工资

select t1city,avg(t2salary)

from store t1 inner join employee t2 on t1store_id=t2store_id

where exists(select from employee t3

where t1store_id=t3store_id and t3salary<1000)

group by t1city

其他的自己看吧,比较简单

5、每个城市工资最高的员工信息

select t2city,t1 from employee t1 inner join store t2 on t1store_id=t2store_id

where exists(

select from (

select t1city,max(salary) from store t1 inner join employee t2 on t1store_id=t2store_di

group by t1city) tt where t1city=ttcity and t2salary=ttsalary)

6、查询每个城市的员工总工资,总的店面面积(),门店的数量,员工数量,最高/最低工资数

以上就是关于求计算机考试试题。!全部的内容,包括:求计算机考试试题。!、java和数据库的笔试题一样吗、数据库中的运算符——join运算符的作用等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/10162810.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-05
下一篇 2023-05-05

发表评论

登录后才能评论

评论列表(0条)

保存