下载此文档

实验五 数据查询——复杂查询.doc


文档分类:IT计算机 | 页数:约6页 举报非法文档有奖
1/6
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/6 下载此文档
文档列表 文档介绍
实验五数据查询——复杂查询
一、实验目的




二、实验环境(实验的软件、硬件环境)
硬件:PC机软件:SQL2000
三、实验指导说明
请复习相关的查询知识点并完成如下内容。
四、实验内容
,完成如下的查询:
(1)用子查询查询员工“张小娟”所做的订单信息。
select *
from orderMaster
where SaleNo in (
select distinct employeeno
from employee
where employeeName='陈诗杰'
)
(2)查询没有订购商品的且在北京地区的客户编号,客户名称和邮政编码,并按邮政编码降序排序。
select *
from customer c
where not exists (
select *
from orderMaster o
where =
)and Adderss='北京市'
(3)查询订购了“32M DRAM”商品的订单编号,订货数量和订货单价。
select OrderNo,Qty,Price
from orderDetail
where ProductNo in(
select ProductNo
from product
where ProductName='32M DRAM'
)
(4)查询与员工编号“E2008005”在同一个部门的员工编号,姓名,性别,所属部门。
select * from employee
select *
from employee
where Department in (
select Department
from employee
where employeeNo='E2008001'
)
(5)查询既订购了P20050001商品,又订购了P20070002商品的客户编号,订单编号和订单金额
select distinct ,,
from orderDetail,orderMaster
where = and ProductNo='p2006002'
intersect
select ,,
from orderDetail,orderMaster
where = and ProductNo='p2008001'
(6)查询没有订购“52倍速光驱”或“17寸显示器”的客户编号,客户名称。
select customerno,customern

实验五 数据查询——复杂查询 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数6
  • 收藏数0 收藏
  • 顶次数0
  • 上传人373116296
  • 文件大小53 KB
  • 时间2018-08-16