栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

仲舟の数据库实验六

仲舟の数据库实验六

这次作业基本就是考察与或非,没其他什么特别难的地方

--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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/300192.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号