文档库 最新最全的文档下载
当前位置:文档库 › 数据库原理与应用(第3版)答案

数据库原理与应用(第3版)答案

数据库原理与应用(第3版)答案
数据库原理与应用(第3版)答案

《数据库原理与应用》(第三版)习题参考答案

第1 章数据库概述

1.试说明数据、数据库、数据库管理系统和数据库系统的概念。

答:数据是描述事物的符号记录。

数据库是长期存储在计算机中的有组织的、可共享的大量数据的集合。

数据库管理系统是一个专门用于实现对数据进行管理和维护的系统软件。

数据库系统是指在计算机中引入数据库后的系统,一般由数据库、数据库管理系统(及相关的实用工具)、应用程序、数据库管理员组成。

2.数据管理技术的发展主要经历了哪几个阶段?

答:文件管理和数据库管理。

3.与文件管理相比,数据库管理有哪些优点?

答:与文件系统管理数据相比,数据库系统管理数据带来了如下好处:将相互关联的数据集成在一起,较少的数据冗余,程序与数据相互独立,保证数据的安全可靠,最大限度地保证数据的正确性,数据可以共享并能保证数据的一致性。

4.在数据库管理方式中,应用程序是否需要关心数据的存储位置和存储结构?为什么?

答:不需要。因为数据库管理系统提供了逻辑独立性和物理独立性。

5.在数据库系统中,数据库的作用是什么?

答:数据库是数据的汇集,它以一定的组织形式保存在存储介质上。

6.在数据库系统中,应用程序可以不通过数据库管理系统而直接访问数据文件吗?

答:不能

7.数据独立性指的是什么?它能带来哪些好处?

答:数据独立性是指应用程序不会因数据的物理表示方式和访问技术的改变而改变,即应用程序不依赖于任何特定的物理表示方式和访问技术,它包含两个方面:逻辑独立性和物理独立性。

物理独立性是指当数据的存储位置或存储结构发生变化时,不影响应用程序的特性;

逻辑独立性是指当表达现实世界的信息内容发生变化时,不影响应用程序的特性。

8.数据库系统由哪几部分组成,每一部分在数据库系统中的作用大致是什么?

答:数据库系统一般包括数据库、数据库管理系统(及相应的实用工具)、应用程序和数据库管理员四个部分。数据库是数据的汇集,它以一定的组织形式保存在存储介质上;数据库管理系统是管理数据库的系统软件,它可以实现数据库系统的各种功能;应用程序专指以数据库数据为基础的程序,数据库管理员负责整个数据库系统的正常运行。

第2章数据模型与数据库结构

1.解释数据模型的概念,为什么要将数据模型分成两个层次?

答:答:数据模型是对现实世界数据特征的抽象。数据模型一般要满足三个条件:第一是数据模型要能够比较真实地模拟现实世界;第二是数据模型要容易被人们理解;第三是数据模型要能够很方便地在计算机上实现。由于用一种模型来同时很好地满足这三方面的要求在目前是比较困难的,因此在数据库系统中就可以针对不同的使用对象和应用目的,采用不同的数据模型。根据模型应用的不同目的,将这些模型分为两大类:概念层数据模型和组织层数据模型,以方便对信息的描述。

2.概念层数据模型和组织层数据模型分别是针对什么进行的抽象?

答:概念层数据模型是对现实世界的抽象,形成信息世界模型,组织层数据模型是对信息世界进行抽象和转换,形成具体的DBMS支持的数据组织模型。

3.实体之间的联系有哪几种?请为每一种联系举出一个例子。

答:实体之间的联系有一对一、一对多和多对多三种。例如:系和正系主任是一对一联系(假设一个系只有一个正系主任),系和教师是一对多联系(假设一个教师只在一个系工作),教师和课程是多对多联系(假设一个教师可以讲授多门课程,一门课程可由多个教师讲授)。

4.说明实体-联系模型中的实体、属性和联系的概念。

5.指明下列实体间联系的种类:

(1)教研室和教师(设一个教师只属于一个教研室,一个教研室可有多名教师)。

(2)商品和顾客。

(3)国家和首都(假设一个国家的首都可以变化)。

(4)飞机和乘客。

(5)银行和账户。

(6)图书和借阅者。(设一个借阅者可同时借阅多本书,可在不同时间对同一本书借阅多次)

6.数据库系统包含哪三级模式?试分别说明每一级模式的作用?

答:数据库系统包含的三级模式为:内模式、模式和外模式。外模式是对现实系统中用户感兴趣的整体数据结构的局部描述,用于满足不同数据库用户需求的数据视图,是数据库用户能够看见和使用的局部数据的逻辑结构和特征的描述,是对数据库整体数据结构的子集或局部重构。模式是数据库中全体数据的逻辑结构和特征的描述,是所有用户的公共数据视图。内模式是对整个数据库的底层表示,它描述了数据的存储结构。

7.数据库管理系统提供的两级映像的作用是什么?它带来了哪些功能?

答:数据库系统的两级映象是模式与内描述间的映象和外模式与模式间的映象。模式/内模

式的映象带来了物理独立性,即如果数据库的存储结构改变了,可通过调整模式/内模式的映象,使模式能够保持不变。外模式/概念模式间的映象带来了逻辑独立性,当概念模式的结构可发生改变时,也可通过调整外模式/模式间的映象关系,使外模式可以保持不变。

8.数据库三级模式划分的优点是什么?它能带来哪些数据独立性?

答:数据库的三级模式的划分实际上将用户、逻辑数据库与物理数据库进行了划分,使彼此之间的相互干扰减到最少。这三个模式的划分实际上带来了两个数据独立性:物理独立性和逻辑独立性。这使得底层的修改和变化尽量不影响到上层。

第3章关系数据库

1.试述关系模型的三个组成部分。

答:关系数据结构、关系操作集合和关系完整性约束。

2.解释下列术语的含义:

(1)笛卡尔积:设D1,D2,…,D n为任意集合,定义笛卡尔积D1,D2,…,D n为:

D1×D2×…×D n ={(d1,d2,…,d n) | d i∈D i,i=1,2,…,n }

(2)主键:也称主码为或主关键字,是表中的属性或属性组,用于惟一地确定一个元组。(3)候选键:如果一个属性或属性集的值能够惟一标识一个关系的元组而又不包含多余的属性,则称该属性或属性集为候选键。

(4)外键:设F是关系R的一个或一组属性,如果F与关系S的主键相对应,则称F是关系

R的外键。

(5)关系:关系就是简单二维表。

(6)关系模式:二维表的结构称为关系模式。

(7)关系数据库:对应于一个关系模型的所有关系的集合称为关系数据库。

3.关系数据库的三个完整性约束是什么?各是什么含义?

答:实体完整性、参照完整性和用户定义的完整性。

实体完整性是保证关系中的每个元组都是可识别的和惟一的。

参照完整性也称为引用完整性,用于表达现实世界中的实体之间的关联关系。

用户定义的完整性也称为域完整性或语义完整性,用于保证数据库中存储的值与现实世界相符。

4.连接运算有哪些?等值连接和自然连接的区别是什么?

答:连接运算中最重要也是最常用的连接有两个,一个是等值连接,一个是自然连接。

自然连接与等值连接的差别为:

●自然连接要求相等的分量必须有共同的属性名,等值连接则不要求;

●自然连接要求把重复的属性名去掉,等值连接却不这样做。

5.对参与并、交、差运算的两个关系R、S有什么要求?

答:必须结构相同,且相应的属性值取自同一个值域。

6.对参与除运算的两个关系(R÷S)有什么要求?除运算的结果关系中包含哪些属性?

答:R中必须包含S的全部或部分属性,除运算的结果包含的属性是只属于R不属于S的属性。7.对参与自然连接和等值连接操作的两个关系R、S有什么要求?

答:有语义相同的属性。

8.投影操作的结果关系中是否有可能存在重复的记录?为什么?

答:不可能,因为投影运算会自动去掉投影后重复的记录。

9.利用表3-10至3-12所示的三个关系,写出实现如下查询要求的关系代数表达式。

(1)查询“信息系”学生的选课情况,列出学号、姓名、课程号和成绩。

∏Sno, Sname, Cno, Grade(σSdept=‘信息系’( Student))

或:∏Sno, Sname, Cno, Grade(σSdept=‘信息系’(Student))

(2)查询“VB”课程的考试情况,列出学生姓名、所在系和考试成绩。

∏Sname, Sdept, Grade(σCname=‘VB’( Student))

或:∏Sname, Sdept, Grade(σCname=‘VB’(Coure Student)

(3)查询考试成绩高于90分的学生的姓名、课程名和成绩。

∏Sname, Cname, Grade(σGrade>90( Student))

或:∏Sname, Cname, Grade(σGrade>90(SC) Student)

(4)查询至少选修了0512101号学生所选的全部课程的学生的姓名和所在系。

∏Sname, Sdept((SC ÷∏Cno(σsno=’0512101’(SC))))

(5)查询至少选了“C01”和“C02”两门课程的学生的姓名、所在系和所选的课程号。

∏Sname, Sdept, Cno((SC ÷∏Sno(σcno=’C01’ V Cno=’C02’(SC))))

(6)查询没有选修第1学期开设的全部课程的学生的学号、姓名和所选的课程号。

∏Sno, Sname, Cno((∏sno(SC) - ∏sno(σsemester=1(SC)))(7)查询计算机系和信息系选了VB课程的学生姓名。

∏Sname(σsdept=’计算机系’V sdept=’信息系’)∧cname=’vb’(Course))

或:∏Sname(σsdept=’计算机系’V sdept=’信息系’(Studentσcname=’vb’(Course))

第4章SQL Server 2012基础

1.安装SQL Server 2012对硬盘及内存的要求分别是什么?

答:SQL Server 2012实际硬盘空间需求取决于系统配置和您决定安装的功能,一般应确保系统

驱动器中是否有至少 6.0 GB 的可用磁盘空间。

内存:Express 版本:最少512 MB;其他版本:最少1 GB。

2.SQL Server实例的含义是什么?实例名的作用是什么?

答:一个实例代表一个独立的数据库管理系统。实例名是实例的标识,用户通过“计算机名/实例名”的方式可访问指定的命令实例。

3.SQL Server 2012的核心引擎是什么?

答:SQL Server(MSSQLSERVER)

4.SQL Server 2012提供的设置服务启动方式的工具是哪个?

答:配置管理器

5.在SQL Server 2012中,每个数据库至少包含几个文件?

答:2个文件,一个数据文件,一个日志文件

6.SQL Server 2012数据库文件分为几类?每个文件有哪些属性?

答:主要数据文件和次要数据文件,属性有:物理文件名及其位置、逻辑文件名、初始大小、增长方式、最大大小。

第5 章数据类型及关系表创建

1.Tinyint数据类型定义的数据的取值范围是多少?

答:0-255

2.SmallDatatime类型精确到哪个时间单位?

答:分钟

3.定点小数类型numeric中的p和q的含义分别是什么?

答:p代表整数位数+小数位数的和值,q代表小数位数。

4.Char(n)、nchar(n)的区别是什么?它们各能存放多少个字符?

答:Char(n)中的n代表能存放n个字节的字符,如果是字母可以存放n个,如果是汉字可存放n/2个。Nchar(n)中的n代表能存放的字符个数。

5.Char(n)和varchar(n)的区别是什么?

答:Char(n)是定长存储,一定占n个字节的空间。Varchar(n)代表最多占n个字节的空间。6.数据完整性约束的作用对象有哪些?

答:表和列

7.CHECK约束的作用是什么?

答:限制列的取值范围。

8.UNIQUE约束的作用是什么?

答:限制列取值不重。

9.DEFAULT约束的作用是什么?

答:提供列的默认值。

上机练习

1.在第4章创建的Students数据库中,写出创建如下三张表的SQL语句,要求在定义表的同时定义数据的完整性约束:

(1)“图书”表结构如下:

书号:统一字符编码定长类型,长度为6,主键;

书名:统一字符编码可变长类型,长度为30,非空;

第一作者:普通编码定长字符类型,长度为10,非空;

出版日期:小日期时间型;

价格:定点小数,小数部分1位,整数部分3位。

create table图书(

书号nchar(6)primary key,

书名nvarchar(30)not null,

第一作者char(10)not null,

出版日期 smalldate,

价格numeric(4,1)

)

(2)“书店”表结构如下:

书店编号:统一字符编码定长类型,长度为6,主键;

店名:统一字符编码可变长类型,长度为30,非空;

电话:普通编码定长字符类型,8位长,每一位的取值均是0~9的数字;

地址:普通编码可变长字符类型,40位长。

邮政编码:普通编码定长字符类型,6位长。

create table书店(

书店编号nchar(6)primary key,

店名nvarchar(30)not null

电话char(8)check(电话like'[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'),地址varchar(40),

邮政编码char(6)

)

(3)“图书销售”表结构如下:

书号:统一字符编码定长类型,长度为6,非空;

书店编号:统一字符编码定长类型,长度为6,非空;

销售日期:小日期时间型,非空;

销售数量:小整型,大于等于1。

主键为(书号,书店编号,销售日期);

其中“书号”为引用“图书表”的“书号”的外键;

“书店编号”为引用“书店表”的“书店编号”的外键。

create table图书销售(

书号nchar(6)not null,

书店编号nchar(6)not null,

销售日期 samlldate,

销售数量smallint check(销售数量>= 1),

primary key(书号,书店编号,销售日期),

foreign key(书号)references图书(书号),

foreign key(书店编号)references书店(书店编号)

)

2.为图书表添加“印刷数量”列,类型为整数,同时添加取值大于等于1000的约束。

Alter table图书add印刷数量int check(印刷数量>= 1000)

3.删除书店表中的“邮政编码”列。

Alter table书店drop column邮政编码

4.将图书销售表中的“销售数量”列的数据类型改为整型。

Alter table图书alter column销售数量int

第6 章数据操作语句

1.简单说明SELECT语句中,FROM、WHERE、GROUP BY、HA VING子句的作用。

答:FROM子句指定数据来自的表,WHERE子句指定行数据的筛选条件,GROUP BY子句指定用于分组的列,HA VING子句用于对分组后的统计值进行筛选。

2.简单说明COUNT(*)与COUNT(列名)的区别。

答:COUNT(*)用于统计行的个数,并且不忽略NULL;COUNT(列名)用于统计该列中非空值个数,这个函数会去掉NULL。

3.在聚合函数中,不忽略空值的函数是哪个?

答:COUNT(*)

4.哪些数据类型的列可以使用SUM(列名)和A VG(列名)函数?

答:数值类型的列

5.外连接和内连接的区别是什么?

答:外连接结果会包含连接中一个表的全部数据,内连接结果是只包含两个表中满足连接条件的数据。

6.TOP子句的作用是什么?

答:限定取查询结果中的前若干行数据。

7.DISTINCT子句的作用是去掉表中的重复行数据,这个说法对吗?

答:应该是去掉查询结果中的重复行数据。

8.简单说明嵌套子查询的执行顺序。

答:嵌套子查询是先执行子查询,然后在根据子查询结果执行外层查询。

上机练习

1.查询学生选课表中的全部数据。

答:select * from SC

2.查询计算机系的学生姓名、年龄。

答:select sname, sage from student where sdept = '计算机系'

3.查询成绩在70~80分之间的学生学号、课程号和成绩。

答:select sno,cno,grade from sc

where grade between 70 and 80

4.查询计算机系年龄在18~20且性别为“男”的学生姓名、年龄。

答:select sname,sage from student

where sdept = '计算机系'

and sage between 18 and 20

and ssex = '男'

5.查询“c01”课程最高分。

答:select max(grade) from sc where cno = 'C01'

6.查询计算机系学生的最大年龄和最小年龄。

答:select max(sage) as max_age, min(sage) as min_age

from student

where sdept = '计算机系'

7.统计每个系的学生人数。

答:select sdept, count(*) 学生人数from student

group by sdept

8.统计每个学生的选课门数和考试总成绩,并按选课门数升序显示结果(不包括没选课的学生)。

答:select sno,count(*) 选课门数, sum(grade) 考试总成绩

from sc

group by sno

order by count(*) asc

9.查询总成绩超过200分的学生,列出学号、总成绩。

答:select sno,sum(grade) 总成绩from sc

group by sno

having sum(grade) > 200

10.查询选了“c02”课程的学生姓名和所在系。

答:select sname,sdept

from student s join sc on s.sno = sc.sno

where cno = 'C02'

11.查询成绩80分以上的学生姓名、课程号和成绩,并按成绩降序排列结果。

答:select sname,cno,grade

from student s join sc on s.sno = sc.sno

where grade > 80 order by grade desc

12.查询哪些学生没有选课,要求列出学号、姓名和所在系。

答:select s.sno, sname, sdept

from student s left join sc on s.sno = sc.sno

Where sc.sno is null

13.统计每门课程的选课人数,列出课程号和选课人数。(包括没人选的课程)答:select https://www.wendangku.net/doc/952281133.html,o,count(https://www.wendangku.net/doc/952281133.html,o) 选课人数

from course c left join sc on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

Group by https://www.wendangku.net/doc/952281133.html,o

14.查询与VB在同一学期开设的课程的课程名和开课学期。

答:select https://www.wendangku.net/doc/952281133.html,ame,c2.semester

from course c1 join course c2 on c1.semester = c2.semester Where https://www.wendangku.net/doc/952281133.html,ame = 'VB' and https://www.wendangku.net/doc/952281133.html,ame != 'VB'

15.查询与李勇年龄相同的学生的姓名、所在系和年龄。

精选文档

答:select S2.Sname,S2.Sdept, S2.sage

from student s1 join student s2 on s1.sage = s2.sage

Where s1.sname = '李勇' and s2.sname != '李勇'

16.查询计算机系年龄最小的2名学生的姓名和年龄。

答:select top 2 with ties sname, sage

from student

Where sdept = '计算机系'

Order by sage asc

17.查询VB成绩最高的前2名学生的姓名、所在系和VB成绩,包括并列的情况。

答:select top 2 with ties sname, sdept, grade

from student s join sc on s.sno = sc.sno

Join course c on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

Where cname = 'VB'

Order by grade desc

18.查询选课门数最多的前2名学生的学号和选课门数,包括并列的情况。

答:select top 2 with ties sno, count(*) 选课门数

from sc

Group by sno

Order by count(*) desc

19.查询学生人数最多的系,列出系名和人数。

答:select top 1 with ties sdept, count(*) 人数

from student

Group by sdept

Order by count(*) desc

20.用子查询实现如下查询:

(1)查询选修了“c01”号课程的学生姓名和所在系。

答:select sname, sdept from student where sno in(

select sno from sc where cno = ' C01')

(2)查询数学系成绩80分以上的学生学号、姓名、课程号和成绩。

答:select sno,sname,cno,grade

from student s join sc on s.sno = sc.sno

where s.sno in(

select sno from sc where grade > 80)

and sdept = '数学系'

(3)查询计算机系考试成绩最高的学生姓名。

答:select sname from student

where sno in(

select top 1 sno from sc join student s on s.sno = sc.sno where sdept = '计算机系'

Order by grade desc )

(4)查询数据结构考试成绩最高的学生姓名、所在系、性别和成绩。

答:select sname,sdept,ssex,grade

from student s join sc on s.sno = sc.sno

where s.sno in(

Select top 1 sno from sc join course c on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o Where cname = '数据结构'

Order by grade desc )

21.查询没选VB课程的学生姓名和所在系。

答:select sname,sdept from student

Where sno not in (

Select sno from sc join course c on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

Where cname = 'VB' )

22.查询计算机系没选课的学生的姓名和性别。

答:select sname,ssex from student

Where sdept = '计算机系'

And sno not in (

Select sno from sc )

23.查询计算机系考试平均成绩最低的学生的姓名及所选的课程名。

答:select sname,cname from student s join sc on s.sno = sc.sno

Join course c on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

where s.sno in (

Select top 1 sno from sc

Where sdept = '计算机系'

Group by sno

Order by avg(grade) asc )

24.查询1~5学期中,选课人数最少的课程的课程名、开课学期和学分。

答:select cname,semester,credit from course

Where semester between 1 and 5

And cno in (

Select top 1 cno from sc

Group by cno

Order by count(*) desc )

25.查询计算机系每个学生的考试情况,列出姓名、课程名和考试成绩,并将查询

结果保存到一个新表中。新表名为:Computer_Dept

答:select sname,cname,grade into Computer_Dept

from student s join sc on s.sno = sc.sno

Join course c on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

Where sdept = '计算机系'

26.创建一个新表,表名为test_t,其结构为:(COL1, COL 2, COL 3),其中:

COL1:整型,允许空值。

精选文档COL2:普通编码字符型,长度为10 ,不允许空值。

COL3:普通编码字符型,长度为10 ,允许空值。

试写出按行插入如下数据的语句(空白处表示空值)。

答:create table test_t(

Col1 int,

Col2 char(10) not null,

Col3 char(10)

)

Insert into test_t values(null,'B1',null)

Insert into test_t values(1,'B2','C2')

Insert into test_t values(2,'B3'’,null)

27.删除考试成绩低于50分的学生的选课记录。

答:delete from sc where grade < 50

28.删除没有人选的课程。

答:delete from course where cno not in(

Select cno from sc )

29.删除计算机系VB成绩不及格学生的VB选课记录。

答:delete from sc

From student s join sc on s.sno = https://www.wendangku.net/doc/952281133.html,o

Join course c on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

where sdept = '计算机系' and cname = 'VB'

and grade < 60

30.删除VB考试成绩最低的学生的VB选课记录。

答:delete from sc

精选文档

From course c join sc on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

Where cname = 'VB'

And grade = (

Select min(grade) from sc

Join course c on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

Where cname = 'VB')

31.将第2学期开设的所有课程的学分增加2分。

答:update course set credit = credit + 2

Where semester = 2

32.将VB课程的学分改为3分。

答:update course set credit = 3

Where cname = 'VB'

33.将计算机系学生的年龄增加1岁。

答:update student set sage = sage + 1

where sdept = '计算机系'

34.将信息系学生的“计算机文化学”课程的考试成绩加5分。

答:update sc set grade = grade + 5

From student s join sc on s.sno = sc.sno

Join course c on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

Where sdept = '信息系'

And cname = '计算机文化学'

35.将选课人数最少的课程的学分降低1分。

答:update course set credit = credit - 1

Where cno in (

Select top 1 cno from sc

Group by cno

Order by count(*) asc )

第7章索引和视图

1.索引的作用是什么?

答:索引可以加快数据的查询效率。

2.索引分为哪几种类型?分别是什么?它们的主要区别是什么?

答:分为聚集索引和非聚集索引两种。聚集索引会对数据进行物理排序,非聚集索引不对数据进行物理排序。

3.在一个表上可以创建几个聚集索引?可以创建多个非聚集索引吗?

答:1个聚集索引。可以。

4.聚集索引一定是唯一性索引,对吗?反之呢?

答:不对。反之也不对。

5.在建立聚集索引时,数据库管理系统是真正将数据按聚集索引列进行物理排序。对吗?答:对。

6.在建立非聚集索引时,数据库管理系统并不对数据进行物理排序。对吗?

答:对。

7.不管对表进行什么类型的操作,在表上建立的索引越多越能提高操作效率。对吗?答:不对。

8.经常对表进行哪类操作适合建立索引?适合在哪些列上建立索引?

答:

●返回范围值的查询:BETWEEN AND、>、>=、< 和 <= ;

●不返回大型结果集的查询。

●经常被用作连接的列,一般来说,这些列是外键列。

●ORDER BY或GROUP BY操作。

适合建立索引的情况:

●包含大量非重复值的列。

●在WHERE子句中经常用于进行BETWEEN AND、>、>=、< 和 <=等操作的列。

●经常被用作连接操作的列。

ORDER BY或GROUP BY子句中涉及的列。

9.使用第5章建立的Student、Course和SC表,写出实现下列操作的SQL语句。

(1)在Student表上为Sname列建立一个非聚集索引,索引名为:SnameIdx。

答:Create index SnameIdx on student(Sname)

(2)在Course表上为Cname列建立一个唯一的非聚集索引,索引名为:CNIdx

答:Create unique index CNIdx on Course(Cname)

(3)在SC表上为Sno和Cno建立一个组合的聚集索引,索引名为:SnoCnoIdx。

答:Create clustered index SnoCnoIdx on SC(Sno,Cno)

(4)删除Sname列上建立的SnoIdx索引。

答:drop index SnoIdx on Student

10.试说明使用视图的好处。

答:利用视图可以简化客户端的数据查询语句,使用户能从多角度看待同一数据,可以提高数据的安全性,视图对应数据库三级模式中的外模式,因此提供了一定程度的逻辑独立性。

11. 使用视图可以加快数据的查询速度,这句话对吗?为什么?

答:不对,因为通过视图查询数据时,比直接针对基本表查询数据多了一个转换过程,即从外模式到模式的转换。

12.使用第5章建立的Student、Course和SC表,写出创建满足下述要求的视图的SQL语句。

(1)查询学生的学号、姓名、所在系、课程号、课程名、课程学分。

答:Create view v1 As

Select s.sno,sname,sdept,https://www.wendangku.net/doc/952281133.html,o,cname,credit

From student s join sc on s.sno = sc.sno

Join course c on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

(2)查询学生的学号、姓名、选修的课程名和考试成绩。

答:Create view v2 As

Select s.sno,sname,cname,grade

From student s join sc on s.sno = sc.sno

Join course c on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

(3)统计每个学生的选课门数,要求列出学生学号和选课门数。

答:Create view v3 As

Select sno,count(*) as total

From sc group by sno

(4)统计每个学生的修课总学分,要求列出学生学号和总学分(说明:考试成绩大于等于60才可获得此门课程的学分)。

答:Create view v4 As

Select sno,sum(credit) as total_credit

From sno join course c on https://www.wendangku.net/doc/952281133.html,o = https://www.wendangku.net/doc/952281133.html,o

Where grade >= 60

Group by sno

13.利用第12题建立的视图,完成如下查询:

(1)查询考试成绩大于等于90分的学生的姓名、课程名和成绩。

答:Select sname,cname,grade From v2 where grade >= 90

(2)查询选课门数超过3门的学生的学号和选课门数。

答:Select * from v3 where total >= 3

(3)查询计算机系选课门数超过3门的学生的姓名和选课门数。

答:Select sname,total from v3 join student s on s.sno = v3.sno Where sdept = '计算机系' and total >= 3

(4)查询修课总学分超过10分的学生的学号、姓名、所在系和修课总学分。

答:Select v4.sno,sname,sdept,total_credit

From v4 join student s on s.sno = v4.sno

Where total_credit >= 10

(5)查询年龄大于等于20岁的学生中,修课总学分超过10分的学生的姓名、年龄、所在系和修课总学分。

答:Select sname,sage,sdept,total_credit

新视野大学英语读写教程2(第三版)第二单元练习答案

Unit 2 Section A 3 1 promotes 2 accelerate 3 mystery 4 insight 5 boost 6 analysis 7 calculate 8 barriers 9 destruction 10 prospect 4–ing promising bearing housing -ive objective offend exclude excess execute -ify intensify identify 5 1 excess 2 bearing 3 objective 4 intensify 5 execute 6 promising 7 exclude 8 identity 9offend 10 housing 6 1 C 2 H 3 D 4 J 5 B 6 L 7 M 8 G 9 F 10 A 7 1 are liable to 2 in favor of 3 is bound to 4 speculate about 5 invested…with 6 stand up for 7 in the form of 8 prepared for 9 in the company of 10 in succession 9慕课是一种网络课程,它旨在通过网络实现广泛参与和开放接入。慕课是远程教育迈出的最新一步,现已在高等教育领域迅速引领潮流。通过这些课程,大学可以扩大影响的范围,从影响成千上万住在城里付学费的学生,扩展到惠及全球上百万的学生。除了拥有传统的课程资源,慕课还给使用者特供互动论坛,支持学生和讲师之间的交流。慕课能够促进参与者之间的交流,使得多种观点、知识和技能涌现到课堂上来;它鼓励人们尝试之前不可能尝试的课程,甚至是尝试新的教育方式;它提供多种学习课程资料的方式,鼓励多模式学习,以各种学习风格满足学习者的需求;另外,慕课促进教学的改善,使技术在面对面授课中得以更好地应用。 10 In recent years, with the development of Internet technology, the construction of digital education resources of our country has made great achievements. Many universities have set up their own digital learning platforms, and digital teaching is playing an increasingly important role in education. Compared with the traditional way of teaching, the digital way has a lot of advantages. On one hand, digital teaching makes global sharing of teaching resources possible; on the other hand, it expands the learner’s study time and space to learn, allowing people to get access to the digital virtual schools through the Internet anytime and anywhere. These advantages make it possible for people to shift from one-time learning to lifelong learning. Section B 1 1 Main idea: College has never been magical for everyone. Major detail: More high school graduates don’t fit the pattern of college. 2 Main idea: We need to revise our attitudes and reform the system. Major detail: We only judge things based on our own college experiences. 3 Main idea: College education seems to have wasted time and accumulated debt Major detail: Close to 80 percent of new jobs can be performed by someone without a college degree. 2 1 C 2 D 3 C 4 A 5 D 6 B 7 B 8 A 4 1 enroll 2 revise 3 accumulate 4 accorded 5 evaluate 6 prime 7 confirm 8 shrinking 9 sufficient 10 recruit 5 1 bother to 2 is available to 3 been compelled to 4 described…as 5 exposed…to 6 rather than 7 have something to do with 8 for its own sake 61 A teacher, no matter how knowledgeable he is, cannot teach his students everything they want to know.

新视野大学英语(第三版)读写教程第三册课后答案

Unit 1 TEXT A Language focus Word in use [3] 1.whereby 2. pursuit 3. inhibit 4. maintain 5. patriotic 6. transcend 7. endeavor 8. dedication 9. prestige 10. nominate Word building [4] [5] 1.resultant 2. tolerant 3. pollutants 4. inhabited 5. participants 6. descendants 7. attendants 8. respectful 9. contestants 10. neglectful 11. resourceful 12. boastful Banked cloze [6] 1.eventually 2. premier 3. endeavor 4. bypass 5. handicaps 6. committed 7. attained 8. transcend 9. feats 10. slightest Expressions in use [7] 1. removed from 2. failed in 3. in pursuit of 4. deviated from 5. precluded from 6. triumph over 7. work their way into 8. written off

TEXT B Understanding the text [2] CBADBBCD Language focus Word in use [4] 1.indulge 2. propelled 3.aggravated 4.dazzled 5. alleviated 6.renowned 7.eloquent 8. destined 9.scorns 10. Applause Expression in use [5] 1.up 2.in 3.on 4.up 5.to 6.on 7.as 8.out sentence structure [6] 1.He prefers to start early rather than leave everything to the last minute 2.She prefers to be the boss, to be in charge and to organize others rather than be organized by some whom she may not even rate very highly. 3.My brother prefers to take the whole blame himself rather than allow it to fall on the innocent. [7] 1. Try as he would 2. Search as they would 3. Hard as we work Try as we might Collocation Warm-up 1. repeated 2.overwhelming 3.immense 1.heroic 2.sound 3.substantial 1.attained 2.fueled 3.achieved [8] 1. sudden opportunities 2. immense obstacles 3. amazing determination 4. profound difficulties 5. overwhelming failures 6. poverty-stricken 7. substantial hardship 8. repeated misfortunes 9. sheer persistence 10. dazzle audiences 11. achieve fame 12. strong will

现代大学英语精读3第二版第一课习题答案

define the word resent the treatment frustrate the students declare war evaluate the result perform one’s duty narrow the gap expand business present the facts decorate a room be my haunting memory take a deep breath give a hint stretch one's neck drift on the river let it go at that prick up its ears ripple in the breeze hover over the trees a bond between brothers a carpet for you to walk on snap the door to be serious out of proportion to the occasion go for a picnic put one's arms round her scratch each other’s backs Publish or perish. make RMB convertible seek the truth discard conventions satirize people’s vanity and extravagance The island is uninhabited, and being without drinking water, is also uninhabitable. admire their courage/guts/bravery neglect one’s duty escape/avoid the consequence erase/delete sth from one’s memory take command block the way / stand in the way / be in one’s way ruin one’s reputation/name

新视野大学英语(第三版)读写教程2第六单元练习答案

Unit 6 Section A 3 1 implement 2 rival 3 motivating 4 discarded 5 fluctuating 6 prejudiced 7 restore 8 enlightening 9 profit 10 investigate 4–ic strategic sympathetic -ion confirmation location reflection provision installation registration quote -ize sympathize criticize industrialize 5 1 sympathize 2 confirmation 3 strategic 4 installation 5 quote 6 sympathetic 7 criticize 8 location 9 reflection 10 industrialize 11 provision 12 registration 6 1 M 2 D 3 H 4 O 5 F 6 L 7 I 8 C 9 J 10 A 7 1 was attached to 2 be measured in 3 come in handy 4 clinging to 5 pay a big price 6 are exhausted from 7 impose on 8 revolve around 9极简主义是指去掉多余的,仅保留需要的部分。用最简单的话来说,极简的生活方式,就是生活得越简单越好,直到获得心灵的平静,这种简单既是精神上的,也是身体上的。这种生活方式会减轻压力,带来更多自由时间,并增强幸福感。极简主义者会说,他们生活得更有意义了,更从容了,极简的生活方式让他们着眼于生活中更重要的事物:朋友、爱好、旅游和体验。当然,极简主义并不意味着拥有物质财富从本质上来讲有什么不对。现在的问题似乎在于,我们往往太重视所拥有的东西,而常常抛弃了健康、人与人之间的关系、我们的热情、个人成长,以及帮助他人的愿望。极简主义除了在我们的日常生活中可以得到应用,还存在于很多创意领域,包括艺术、建筑、设计、舞蹈、电影、戏剧、音乐、时尚、摄影和文学等。 10 National Happiness Index (NHI) is an index that measures how happy people are. It is also a tool that measures the levels of economic development and people’s livelihood and happiness in a country or region. With the fast growth of Chinese economy, the Chinese government has been paying more and more attention to people’s living quality and the increase of happiness index. The government stresses improvement of its people’s livelihood, striving to improve their economic conditions and meet their growing material and cultural needs. Currently, the Chinese government advocates the unleashing of more reform dividends, with the aim of offering more real benefits to its people. All these measures will combine to effectively increase the NHI of our people. Section B 1 Because he thought he could get the jeans he wanted right away. 2 Since there were too many choices of jeans, the author simply didn’t know what particular one to choose. 3 He must feel headache and become impatient in this simple transaction. He probably even considered it nothing but torture. 4 Modern life provides people with more options than they used to have, and material choices are incredibly abundant, but do people feel happier? 5 People in modern times are not really happy even when they are surrounded with abundant material goods and so many options. 6 Too many options and considerable material possessions won’t necessarily bring people happiness and satisfaction. 7 Human beings are greedy by nature, nad the tendency of thinking “The more, the better” could

新视野大学英语第三版课后答案

新视野大学英语第三版课后答案 Unit 1 III 1 ben eath 2 disguised 3 whistles 4 restra in 5 grasp 6 longing 7 pray ing 8 faithful 9 pledge 10 drain IV 1 tell …on you 2 track down 3 work it out 4 picking on me 5 reckoned with 6 call on 7 on his own 8 get through 9 in disguise 10 revolves around V G O D I K L B F A N VI 1 advise 2 level 3 problems 4 n ecessity 5 skills 6 experie nee 7 solutio n 8 value 9 tool 10 manner VII 1 air-conditioned(装空调的;有冷气的) 2 handmade (手工制作的) 3 thunderstruck (非常吃惊的) 4 heartfelt (衷心的;诚挚的) 5 data-based (基于数据的) 6 self-employed (自主 经营的)7 custom-built (定制的;定做的)8 weather-beaten (饱经风霜的) VIII 1. well-informed (对.. 非常熟悉的) 2 new-found (新获得的) 3 hard-earned (辛苦挣得的)4 soft-spoken (说话温柔的) 5 newly-married (新婚的)6 widely-held (普遍认为的) 7 well-meant (出于好意的)8 well-educated (受过良好教育的) IX 1 no matter how different it may seem form any other substance 2 no matter what a woman tries to do to improve her situation 3 no matter what excuse he gives 4 no matter what anyone else may think 5 no matter how they rewrite history X 1 just as we gained fame in victory, we lost nothing in defeat 2 just as the head teacher plays a significant role in the school, Jane plays a significant role f leader in the classroom. 3 whoever was out there obviously couldn ' t see him just as he couldn' t see them. 4 she has bee n search ing all her life for the perfect chocolate just as I have bee n search ing for the perfect beer. 5 you can make those kinds of comparis ons just as you were doing the an alyses a minute ago. XI 1. No matter how experieneed a speaker you are, and how well you have prepared your speech, you will have difficulty making a speech at such a no isy recepti on. 2. Just as all his sister' s friends cared about him, Jimmy cared about them. 3. Car manufacturers stamp a vehicle identification number at several places on new cars to help track dow n stole n vehicles. 4. If you dare tell on me when the teacher gets back I won ' t say a word to you any more.

新视野大学英语第三版第二册读写教程2课后标准答案和翻译

Unit 1Language in mission Text A An impressive English lesson Ex.1 Understanding the text 1、Because he is tired of listening to his father and he is not interested in grammar rules. 2、 The civilization of Greece and the glory of Roman architecture are so marvelous and remarkable that they should be described at least in a brief account 。 however, what the student could do was only one single utterance : “whoa! ” without any any specific comment. 3、Because the schools fail to set high standards of language proficiency. They only teach a little grammar and less advanced vocabulary. And the younger teachers themselves have little knowledge of the vital structures of language. 4、Because teaching grammar is not an easy job and most of the students will easily get bored if it ’ s not properly dealt with. 5、He familiarized his son with different parts of speech in a sentence and discussed their specific grammatical functions including how to use adverbs to describe verbs. 6、Because the son had never heard about the various names and functions of words in an English sentence before. 7、The author uses “ road map ” and “ car”to describe grammar and vocabulary. Here, “road map” is considered as grammar and “ car” as vocabulary. 8、 Since the subjunctive mood his son used is a fairly advanced grammar structure, the interjection“ whoa! ”reflects the tremendous pride the father had toward his son 。 it also reflects the author ’s humor in using the word because it was once used by his student, though in two different situations and with two different feelings. Ex.3 Words in use 1.condense 2.exceed 3.deficit 4.exposure 5.asset 6.adequate https://www.wendangku.net/doc/952281133.html,petent 8.adjusting 9.precisely 10.beneficial Ex.4 Word building -al/-ial:managerial/editorial/substance/survival/tradit ion/margin -cy :

现代大学英语第二版精读三课后习题答案unit1

现代大学英语第二版精读三杨立民、徐克容版课后习题答案 Unit1 Vocabulary: 1、into English 1、define this word 2、resent this treatment 3、frustrate students 4、declare war 5、evaluate the result 6、perform the duty 7、narrow the gap 8、expand the business 9、present the facts 2、1、occurrence occur 2、apply applicants pursuits occurry 3、involves handled handling pursue 4、observant occurrence 5、observation observed occur 6、handle occur 7、observed application 8、occurred involvement 9、observers handled 10、observation 3、1、he is so devoted to his research that it never occurs to him that he will soon have to retire. 2、many people have observed that without effective

checks we all have a tendency to abuse our power. 3、some countries refuse to get involved in this dispute and they resent any foreign interference. 4、the control of sandstorms will involve a tremendous amount of work money. 5、you must take the local conditions into consideration when you apply these technologies. 6、all applicants will have to fill out these forms, and mail in an application fee of 50 dollars. 7、he concluded that learning is a natural pleasure, which based on the observation of children’s behavior. 8、in a multi-ethnic country, ethnic harmony requires very careful handling. 9、the government decided to punish all the corrupt officials involved. 10、cheating on exams does not often occur, but when it does, the school will take a tough position. 4、CBCAC DABDA 5、

新视野大学英语第三版读写教程2课后翻译答案

Unit1中国书法 中国书法(calligraphy)是一门独特的艺术、是世界上独一无二的艺术瑰宝。中国书法艺术的形成,发展与汉文字的产生与演进存在着密不可分的关系。汉字在漫长的演变发展过程中,一方面起着交流思想、继承文化的重要作用,另一方面它本身又形成了一种独特的艺术。书法能够通过作品把书法家个人的生活感受、学识、修养、个性等折射出来,所以,通常有“字如其人”的说法。中国书法不仅是中华民族的文化瑰宝,而且在世界文化艺术宝库中独放异彩。 Chinese calligraphy is a unique art and the unique art treasure in the world. The formation and development of the Chinese calligraphy is closely related to the emergence and evolution of Chinese characters. In this long evolutionary process, Chinese characters have not only played an important role in exchanging ideas and transmitting culture but also developed into a unique art form. Calligraphic works well reflect calligraphers' personal feelings, knowledge, self-cultivation, personality, and so forth, thus there is an expression that "seeing the calligrapher's handwriting is like seeing the person". As one of the treasures of Chinese culture, Chinese calligraphy shines splendidly in the world's treasure house of culture and art. Unit2互联网 近年来,随着互联网技术的发展,我国的数字化教育资源建设取得了巨大的成就。很多高校建立了自己的数字化学习平台,数字化教学在教育中发挥着越来越大的作用。和传统教学方式相比,数字化教学方式有很大的优势。一方面,数字化教学使教学资源得以全球共享;另一方面,它拓展了学习者的学习时间和空间,人们可以随时随地通过互联网进入数字化的虚拟学校学习。这使得人类从接受一次性教育走向终身学习成为可能。 In recent years, with the development of Internet technology, the construction of digital education resources of our country has made great achievements. Many universities have set up their own digital learning platforms, and digital teaching is playing an increasingly important role in education. Compared with the traditional way of teaching, the digital way has a lot of advantages. On one hand, digital teaching makes global sharing of teaching resources possible on the other hand, it expands the learner's study time and space to learn, allowing people to get access to the digital virtual schools through the Internet anytime and anywhere. These advantages make it possible for people to shift from one-time learning to lifelong learning. Unit3 孝道(filial piety)是中国古代社会的基本道德规范(code of ethics)。中国人把孝视为人格之本、家庭和睦之本、国家安康之本。由于孝道是儒家伦理思想的核心,它成了中国社会千百年来维系家庭关系的道德准则。它毫无疑问是中华民族的一种传统美德。孝道文化是一个复合概念,内容丰富,涉及面广。它既有文化理念,又有制度礼仪(institutional etiquette)。一般来说,它指社会要求子女对父母应尽的义务,包括尊敬、关爱、赡养老人等等。孝道是古老的"东方文明"之根本。 Filial piety is the basic code of ethics in ancient Chinese society. Chinese people consider filial piety as the essence of a person's integrity, family harmony, and the nation's well-being. With filial piety being the core of Confucian ethics, it has been the moral standard for the Chinese society to maintain the family relationship for thousands of years. It's undoubtedly a traditional Chinese virtue. The culture of filial piety is a complex concept, rich in content and wide in range. It includes not

新视野大学英语读写教程第三版课后答案

新视野大学英语读写教 程第三版课后答案 Document number【SA80SAB-SAA9SYT-SAATC-SA6UT-SA18】

Unit 1 TEXT A Language focus Word in use [3] 1.whereby 2. pursuit 3. inhibit 4. maintain 5. patriotic 6. transcend 7. endeavor 8. dedication 9. prestige 10. nominate Word building [4]

[5]

1.resultant 2. tolerant 3. pollutants 4. inhabited 5. participants 6. descendants 7. attendants 8. respectful 9. contestants 10. neglectful 11. resourceful 12. boastful Banked cloze [6] 1.eventually 2. premier 3. endeavor 4. bypass 5. handicaps 6. committed 7. attained 8. transcend 9. feats 10. slightest Expressions in use [7] 1. removed from 2. failed in 3. in pursuit of 4. deviated from 5. precluded from 6. triumph over 7. work their way into 8. written off TEXT B Understanding the text [2]

现代大学英语精读3第二版翻译原文集合

1.他对他的研究如此专心致志,从来没有过很快就要退休的念头。 2.很多人都曾说过,如果没有有效的制约,我们都有滥用权利的倾向。 3.有些国家拒绝卷入这一争端,而且他们对外国的干涉非常反感。 4.控制沙尘暴需要大量的工作和资金。 5.你们用这些技术的时候,必须考虑到当地的条件。 6.所有的申请者都必须填好这些表格,然后邮寄50美元的报名费。 7.他根据对孩子们行为的观察得出结论:学习是一种自然的乐趣。 8.在一个多民族的国家里,各民族之间的和谐需要小心处理。 9.政府决定严惩所有涉案的腐败官员。 10.考试作弊并不经常发生,但一旦发生,学校会采取严厉的态度。 1.我怀疑这本书也许已经不再印了。我去问书店的工作人员,他们说我说的对,这本书已经绝版很多年了。 2.这小说里有一个值得记住的故事,讲的是刘备如何尽量不引起曹操对他的雄心的怀疑,因为如果引起怀疑,他的生命就会有危险。 3.当曹操称他为真正的英雄时,刘备吓的筷子都掉了。但是他聪明地掩盖了他那令人怀疑的举止。 4.第一个嫌疑犯是死者的儿子。警察怀疑他谋杀了他的父亲,因为邻居们在案发当晚曾听到他们打架。

5.在学习当中,重要的不是把一切都记住,而是运用你的想象力,创造性地、批判性地去进行思考。 6.他肯定是你能想象到的最可笑的窃贼了。他偷偷进了屋子,尽情地吃喝,最后酩酊大醉,一脸满足的笑容,直到第二天早上被发现。 7.我现在记人的名字很困难。我想这肯定是年老造成的。 8.我们生活在很多想象的威胁当中,结果就常常感到沮丧。 9.我怀疑我们的教师有时候低估了学生的智力。其实年轻人脑子里充满了想象。 1.他们都伸长脖子想看个究竟,就好像被一根无形的绳子牵着。 2.我们下车去伸伸胳膊和腿。我们前面是一片美丽的开阔地。 3.他们连续谈判了好几个小时,但是仍然没有解决他们之间的分歧。 4.尽管有温暖的天气、新鲜的空气和美味的佳肴,她的健康仍然没有恢复。 5.他瞟了那辆车一眼就知道它没法修了。他望望前面,只见一眼忘不到头的沙漠,荒无人烟。他知道他陷入困境了。 6.武松奋力举起哨棒向老虎打去。但是哨棒“啪”的一声断了,而老虎毫发未伤。他一急打到附近树上去了。 7.我非常喜欢你在俄罗斯拍的那些照片,尤其是那张上面有个马车夫坐在黑海边,膝盖上放着一块布,不上放着他的晚餐的照片。 8.——“这是您不能就此罢休。”我向他请求道。

新视野大学英语第三版第二册读写教程2课后答案和翻译

Unit 1 Language in mission Text A An impressive English lesson Ex.1 Understanding the text 1、Because he is tired of listening to his father and he is not interested in grammar rules. 2、The civilization of Greece and the glory of Roman architecture are so marvelous and remarkable that they should be described at least in a brief account; however, what the student could do was only one single utterance :“whoa!”without any any specific comment. 3、Because the schools fail to set high standards of language proficiency. They only teach a little grammar and less advanced vocabulary. And the younger teachers themselves have little knowledge of the vital structures of language. 4、Because teaching grammar is not an easy job and most of the students will easily get bored if it’s not properly dealt with. 5、He familiarized his son with different parts of speech in a sentence and discussed their specific grammatical functions including how to use adverbs to describe verbs. 6、Because the son had never heard about the various names and functions of words in an English sentence before. 7、The author uses “road map”and “car”to describe grammar and vocabulary. Here,“road map”is considered as grammar and “car”as vocabulary. 8、Since the subjunctive mood his son used is a fairly advanced grammar structure, the interjection“whoa!”reflects the tremendous pride the father had toward his son; it also reflects the author’s humor in using the word because it was once used by his student, though in two different situations and with two different feelings. Ex.3 Words in use 1.condense 2.exceed 3.deficit 4.exposure 5.asset 6.adequate https://www.wendangku.net/doc/952281133.html,petent 8.adjusting 9.precisely 10.beneficial Ex.4 Word building -al/-ial: managerial/editorial/substance/survival/tradition/margin -cy : consistency/accuracy/efficient -y : recovery/ministry/assembly Ex.5 Word building

相关文档
相关文档 最新文档