云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > sql server实验报告

sql server实验报告

  • 62 次阅读
  • 3 次下载
  • 2025/5/8 0:02:41

c.orderNo and c.productNo = b.productNo and exists( select customerNo

from OrderMaster e,OrderDetail f

where e.customerNo = a.customerNo and e.orderNo = f.orderNo

group by customerNo having count(productNo)>=3)

8.找出目前销售业绩超过4000元的业务员编号和销售业绩,并按销售业绩从大到小排序

select a.employeeNo, sum(orderSum) from employee a, OrderMaster b where a.employeeNo = b.salerNo group by a.employeeNo having sum(orderSum)>4000

order by sum(orderSum) desc

9.求每位客户订购的每种商品的总数及平均单价,并按客户号、商品号从小到大排序

select distinct a.customerNo 客户编号, ProductNo 商品编号, sum(quantity) 商品总数, avg(price) 平均单价 from customer a, OrderDetail b, OrderMaster c where a.customerNo = c.customerNo and b.orderNo =

c.orderNo

group by a.customerNo,ProductNo order by a.customerNo, productNo

10.查询业绩最好的业务员编号,业务员姓名及其总销售金额

select employeeNo 业务员编号, employeeName 业务员姓名, max(orderSum)销售金额 from Employee a, OrderMaster b where a.employeeNo = b.salerNo group by employeeNo, employeeName

having max(orderSum) in( select max(sumOrder) from(

select orderNo, max(orderSum) sumOrder from OrderMaster group by orderNo) c)

11.查询订购的商品至少包含了订单200803010001中所订购的商品的订单

select *

from OrderMaster a where not exists( select *

from OrderDetail b

搜索更多关于: sql server实验报告 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

c.orderNo and c.productNo = b.productNo and exists( select customerNo from OrderMaster e,OrderDetail f where e.customerNo = a.customerNo and e.orderNo = f.orderNo group by customerNo having count(productNo)>=3) 8.找出目前销售业绩超过4000元的业务员编号和销售业绩,并按销售业绩从大到小排序 select a.employeeNo, sum(orderSum) from employee a, OrderMaster b where a.employeeNo = b

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com