数据库系统基础教程第三版考试第十章课后题 关于 授权图

数据库系统原理04735课后习题参考答案_百度文库
您的浏览器Javascript被禁用,需开启后体验完整功能,
享专业文档下载特权
&赠共享文档下载特权
&100W篇文档免费专享
&每天抽奖多种福利
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
数据库系统原理04735课后习题参考答案
&&数据库系统原理04735课后习题参考答案
阅读已结束,下载本文需要
定制HR最喜欢的简历
下载文档到电脑,同时保存到云知识,更方便管理
加入VIP
还剩20页未读,
定制HR最喜欢的简历
你可能喜欢数据库系统与应用课后习题答案_百度文库
您的浏览器Javascript被禁用,需开启后体验完整功能,
享专业文档下载特权
&赠共享文档下载特权
&100W篇文档免费专享
&每天抽奖多种福利
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
数据库系统与应用课后习题答案
阅读已结束,下载本文需要
定制HR最喜欢的简历
下载文档到电脑,同时保存到云知识,更方便管理
加入VIP
还剩6页未读,
定制HR最喜欢的简历
你可能喜欢 上传我的文档
 上传文档
 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
数据库系统教程(第三版)总复习练习和习题(完整版)
下载积分:2000
内容提示:数据库系统教程(第三版)总复习练习和习题(完整版)
文档格式:DOCX|
浏览次数:184|
上传日期: 03:04:06|
文档星级:
全文阅读已结束,如果下载本文需要使用
 2000 积分
下载此文档
该用户还上传了这些文档
数据库系统教程(第三版)总复习练习和习题(完整版)
关注微信公众号本文为机械工业出版社 出版的《数据库系统基本教程(第三版)》一些课后习题的数据库操作命令。
#创建产品数据库
#使用产品数据库
#创建产品表
create table Product(
maker char(5),
model int(10),
type char(10)
create table PC(
model int(10),
speed float,
ram int(7),
hd int(5),
price int(7)
#创建Laptop表
create table Laptop(
model int(10),
speed float,
ram int(7),
hd int(5),
screen float,
price int(7)
#创建printer表
create table Printer(
model int(10),
color char(10),
type char(15),
price int(7)
#插入product数据
insert into Product (maker,model,type)
('A',1001,'pc'),
('A',1002,'pc'),
('A',1003,'pc'),
('A',2004,'laptop'),
('A',2005,'laptop'),
('A',2006,'laptop'),
('B',1004,'pc'),
('B',1005,'pc'),
('B',1006,'pc'),
('B',2007,'laptop'),
('C',1007,'pc'),
('D',1008,'pc'),
('D',1009,'pc'),
('D',1010,'pc'),
('D',3004,'printer'),
('D',3005,'printer'),
('E',1011,'pc'),
('E',1012,'pc'),
('E',1013,'pc'),
('E',2001,'laptop'),
('E',2002,'laptop'),
('E',2003,'laptop'),
('E',3001,'printer'),
('E',3002,'printer'),
('E',3003,'printer'),
('F',2008,'laptop'),
('F',2009,'laptop'),
('G',2010,'laptop'),
('H',3006,'printer'),
('H',3007,'printer');
insert into PC(model,speed,ram,hd,price)
values(,4),
(,512,250,955),
(,512,80,478),
(,512,250,630),
(,512,80,529);
#插入Laptop表
insert into Laptop
(,.1,3673),
(,.0,949),
(,512,60,15.4,549),
(,512,60,13.3,1150),
(,.0,2500),
(,.4,1700),
(,.3,1429),
(,.4,900),
(,512,80,14.1,680),
(,.4,2300);
#插入Printer表
insert into Printer
(3001,'true','ink-jet',99),
(3002,'false','laser',239),
(3003,'true','laser',899),
(3004,'true','ink-jet',120),
(3005,'false','laser',120),
(3006,'true','ink-jet',100),
(3007,'true','laser',200);
#查询速度大于3.00的pc型号
select model
where speed&=3.00;
#查询能生产硬盘容量100GB以上的笔记本电脑的厂商
select distinct maker
from product
model in (
select distinct model
from Laptop
where hd&100);
#查询厂商B生产的所有产品的型号和价格
(select product.model,pc.price
from product,pc
where product.maker="B"and product.model=pc.model)union
(select product.model,laptop.price
from product,laptop
where product.maker="B" and product.model=laptop.model )union
(select product.model,printer.price
from product,printer
where product.maker="B"and product.model=printer.model);
#查询所有彩色激光打印机的型号
from Printer
where color='true'and type='laser';
#查询那些只售笔记本不售PC的厂商
select distinct product.maker
from product,laptop
where product.model=laptop.model and product.maker not in(
select product.maker
from product,pc
where product.model=pc.model);
select distinct maker from product
where type="laptop"
and maker not in
(select maker from product where type="pc");
#查询在两种以上PC机中出现过的硬盘容量
group by hd
having count(hd)&=2;
#找出所有价格低于1000的个人计算机的型号、速度和硬盘的大小
select model ,speed,hd
where price&1000;
#同上条,改名
select model ,speed as gigahertz,hd as gigabytes
where price&1000;
#查找所有打印机制造商
select distinct maker
from Product
where type='printer';
#价格高于1500的笔记本电脑型号、内存、屏幕尺寸
select model,ram,screen
from laptop
where price&=1500;
#找出所有彩色打印机元祖
from printer
where color='true';
#找出速度为3.2且价格低于2000的个人计算机的型号和硬盘大小
select model,hd
where speed&=3.2 and price &=2000;
#6.5.1 a)
#通过两条INSERT语句在数据库中添加如下信息:
#厂商C生产的型号为1100的pc,其速度为3.2,RAM容量大小为1024,硬盘容量为180,售价为2499
insert into product
values('C',1100,'PC');
insert into pc
values(,9);
#删除所有硬盘容量低于100GB的pc
delete from pc
where hd&100;
///////////////////////////////////////////////////
#删除所有不生产打印机厂商生产的笔记本电脑
#第一步:删除laptop表
delete from laptop
where laptop.model in(
select product.model
from product
where maker not in(
select distinct maker
from product where type ='printer'
#错误的方式删除product
delete from product
where maker not in(
select distinct maker
from product where type ='printer'
#第二步:通过中间表删除product中数据
delete from product
where maker not in(
select a.maker from
( select distinct a.maker from product a where a.type ='printer')a
#厂商A收购了厂商B,将所有B生产的产品改为由A生产
update product
set maker='A'
where maker='B';
#对于每台pc,将其RAM容量加倍,并将其硬盘容量增加60GB。
set ram=ram*2,hd=hd+60;
#选择数据库
#创建MovieStar
create table MovieStar(
name char primary key,
address char,
gender char,
birthdate date
#创建MovieExec
create table MovieExec(
name char,
adress char,
netWorth int,
primary key (name,cert)
#创建表studio
create table studio(
name char,
address char,
presc int,
primary key(name)
#视图RichEXec给出了所有资产在以上的制片人的名字、地址、证书号、资产
create view RichExec as
select * from MovieExec
where networth&;
#视图StudioPress给出了既是电影公司经理(Studio president)
#又是制片人(Movie Executive)的那些人的名字,地址和证书号
create view StudioPress as
select studio.name as name,studio.address as address ,presc
from movieExec,Studio
where Studio.name=movieexec.
#视图ExecutiveStar给出了既是制片人又是演员的那些人的名字,地址,性别、生日,证书号和资产总值
create view ExecutiveStar as
select MovieStar.name as name,MovieStar.address as address,gender,birthdate,cert,networth
from MovieStar,MovieExec
where MovieStar.name=MovieExec.
#显示RichEXec表中元素名称
show columns from RichEX
#显示StudioPress表中元素名称
show columns from StudioP
#显示ExecutiveStar表中元素名称
show columns from ExecutiveS
Oracle数据库基础教程:入门其实很简单
Oracle数据库基础教程:入门其实很简单
Oracle数据库系统是目前最流行的客户/服务器数据库之一。本文集从初学者的角度出发,由浅入深、循序渐进地介绍了Oracle数据库开发的基础知识。...
数据库系统概论第五版习题解析
数据库系统概论前七章习题解析
第1章 绪论
1 .试述数据、数据库、数据库系统、数据库管理系统的概念。 答:
( l )数据( Data ) :描述事物的符号记录称为数据。数据的种类有数字、...
[数据库系统基础:高级篇(第5版)pdf
下载地址:网盘下载
目录第一部分 事务处理的概念第1章 事务处理的概念与理论简介1.1 事务处理简介1.2 事务和系统概念1.3 事务的描述特性1.4 描述基于可恢复性调度的特征1.5 描述基于可串...
数据库系统概念(机械工业出版社,第六版)复习——第三章:SQL
SQL功能及操作符
数据查询:select
数据定义:create
数据操纵:insert
数据控制:gran...
数据库系统概念(机械工业出版社,第六版)复习——第二章:关系模型简介
关系模型简介
关系基本概念:
域(Domain)
一组值的集合,这组值具有相同的数据类型
如整数的集合、字符串的集合、全体学生的集合
笛卡尔积(Carte...
没有更多推荐了,数据库系统原理及应用教程_第三版__课后答案(苗雪兰_刘瑞新_著)_机械工程出版社_图文_百度文库
您的浏览器Javascript被禁用,需开启后体验完整功能,
享专业文档下载特权
&赠共享文档下载特权
&100W篇文档免费专享
&每天抽奖多种福利
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
数据库系统原理及应用教程_第三版__课后答案(苗雪兰_刘瑞新_著)_机械工程出版社
阅读已结束,下载本文需要
定制HR最喜欢的简历
下载文档到电脑,同时保存到云知识,更方便管理
加入VIP
还剩76页未读,
定制HR最喜欢的简历
你可能喜欢}

我要回帖

更多关于 数据库实用教程第三版答案第十章 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信