admin 管理员组文章数量: 1087652
仲舟の数据库实验六
这次作业基本就是考察与或非,没其他什么特别难的地方
--l 针对bookshop数据库,完成以下操作:
use bookshop;
--1、 查询既购买了'20652'图书又购买了'22082'图书的订单号。
select order_no
from sale_item
where book_no='20652'
intersect
select order_no
from sale_item
where book_no='22082'--2、 查询购买了'20652'图书或购买了'22082'图书的订单号。
select order_no
from sale_item
where book_no='20652'
union
select order_no
from sale_item
where book_no='22082'--3、 查询购买了'20652'图书但没有购买'22082'图书的订单号。
select order_no
from sale_item
where book_no='20652'
except
select order_no
from sale_item
where book_no='22082'--4、 查询职称是‘经理’或者是‘科长’的员工信息。
select *
from employee
where title='经理'
union
select *
from employee
where title='科长'--5、 在客户表customer中查找住址是'江西南昌'和'广东广州'的客户。
select *
from customer
where cust_addr='广东广州'
union
select *
from customer
where cust_addr='江西南昌'--l 针对S_T数据库
use S_T;
--1、 查询CS系的学生及年龄不大于19岁的学生。
select *
from student
where sdept='CS'
union
select *
from student
where sage<19
后面为付费内容,请加q:792899501联系作者ヾ(•ω•`)o
本文标签: 仲舟の数据库实验六
版权声明:本文标题:仲舟の数据库实验六 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1700300084a386465.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论