文档库 最新最全的文档下载
当前位置:文档库 › 数据库系统基础教程(第二版)课后习题答案

数据库系统基础教程(第二版)课后习题答案

数据库系统基础教程(第二版)课后习题答案
数据库系统基础教程(第二版)课后习题答案

Database Systems: The Complete Book Solutions for Chapter 2

Solutions for Section 2.1

Exercise 2.1.1

The E/R Diagram.

Exercise 2.1.8(a)

The E/R Diagram

Kobvxybz

Solutions for Section 2.2

Exercise 2.2.1

The Addresses entity set is nothing but a single address, so we would prefer to make address an attribute of Customers. Were the bank to record several addresses for a customer, then it might make sense to have an Addresses entity set and make Lives-at a many-many relationship.

The Acct-Sets entity set is useless. Each customer has a unique account set containing his or her accounts. However, relating customers directly to their accounts in a many-many relationship conveys the same information and eliminates the account-set concept altogether.

Solutions for Section 2.3

Exercise 2.3.1(a)

Keys ssNo and number are appropriate for Customers and Accounts, respectively.

Also, we think it does not make sense for an account to be related to zero customers, so we should round the edge connecting Owns to Customers. It does not seem inappropriate to have a customer with 0 accounts; they might be a borrower, for example, so we put no constraint on the connection from Owns to Accounts. Here is the The E/R Diagram,

showing underlined keys and the numerocity constraint.

Exercise 2.3.2(b)

If R is many-one from E1 to E2, then two tuples (e1,e2) and (f1,f2) of the relationship set for R must be the same if they agree on the key attributes for E1. To see why, surely e1 and f1 are the same. Because R is many-one from E1 to E2, e2 and f2 must also be the same. Thus, the pairs are the same. Solutions for Section 2.4

Exercise 2.4.1

Here is the The E/R Diagram.

We have omitted attributes other than our choice for the key attributes of Students and Courses. Also omitted are names for the relationships. Attribute grade is not part of the key for Enrollments. The key for Enrollements is studID from Students and dept and number from Courses.

Exercise 2.4.4b

Here is the The E/R Diagram Again, we have omitted relationship names and attributes other than our choice for the key attributes. The key for Leagues is its

own name; this entity set is not weak. The key for Teams is its own name plus the name of the league of which the team is a part, e.g., (Rangers, MLB) or (Rangers, NHL). The key for Players consists of the player's number and the key for the team on which he or she plays. Since the latter key is itself a pair consisting of team and league names, the key for players is the triple (number, teamName, leagueName).

e.g., Jeff Garcia is (5, 49ers, NFL).

Database Systems: The Complete Book

Solutions for Chapter 3

Solutions for Section 3.1

Exercise 3.1.2(a)

We can order the three tuples in any of 3! = 6 ways. Also, the columns can be ordered in any of 3! = 6 ways. Thus, the number of presentations is 6*6 = 36. Solutions for Section 3.2

Exercise 3.2.1

Customers(ssNo, name, address, phone)

Flights(number, day, aircraft)

Bookings(ssNo, number, day, row, seat)

Being a weak entity set, Bookings' relation has the keys for Customers and Flights and Bookings' own attributes.

Notice that the relations obtained from the toCust and toFlt relationships are unnecessary. They are:

toCust(ssNo, ssNo1, number, day)

toFlt(ssNo, number, day, number1, day1)

That is, for toCust, the key of Customers is paired with the key for Bookings. Since both include ssNo, this attribute is repeated with two different names, ssNo and ssNo1. A similar situation exists for toFlt.

Exercise 3.2.3

Ships(name, yearLaunched)

SisterOf(name, sisterName)

Solutions for Section 3.3

Exercise 3.3.1

Since Courses is weak, its key is number and the name of its department. We do not have a relation for GivenBy. In part (a), there is a relation for Courses and a relation for LabCourses that has only the key and the computer-allocation attribute. It looks like:

Depts(name, chair)

Courses(number, deptName, room)

LabCourses(number, deptName, allocation)

For part (b), LabCourses gets all the attributes of Courses, as:

Depts(name, chair)

Courses(number, deptName, room)

LabCourses(number, deptName, room, allocation)

And for (c), Courses and LabCourses are combined, as:

Depts(name, chair)

Courses(number, deptName, room, allocation)

Exercise 3.3.4(a)

There is one relation for each entity set, so the number of relations is e. The relation for the root entity set has a attributes, while the other relations, which must include the key attributes, have a+k attributes.

Solutions for Section 3.4

Exercise 3.4.2

Surely ID is a key by itself. However, we think that the attributes x, y, and z together form another key. The reason is that at no time can two molecules occupy the same point.

Exercise 3.4.4

The key attributes are indicated by capitalization in the schema below: Customers(SSNO, name, address, phone)

Flights(NUMBER, DAY, aircraft)

Bookings(SSNO, NUMBER, DAY, row, seat)

Exercise 3.4.6(a)

The superkeys are any subset that contains A1. Thus, there are 2^{n-1} such subsets, since each of the n-1 attributes A2 through An may independently be chosen in or out.

Solutions for Section 3.5

Exercise 3.5.1(a)

We could try inference rules to deduce new dependencies until we are satisfied we have them all. A more systematic way is to consider the closures of all 15 nonempty sets of attributes.

For the single attributes we have A+ = A, B+ = B, C+ = ACD, and D+ = AD. Thus, the only new dependency we get with a single attribute on the left is C->A.

Now consider pairs of attributes:

AB+ = ABCD, so we get new dependency AB->D. AC+ = ACD, and AC->D is nontrivial. AD+ = AD, so nothing new. BC+ = ABCD, so we get BC->A, and BC->D. BD+ = ABCD, giving us BD->A and BD->C. CD+ = ACD, giving CD->A.

For the triples of attributes, ACD+ = ACD, but the closures of the other sets are each ABCD. Thus, we get new dependencies ABC->D, ABD->C, and BCD->A. Since ABCD+ = ABCD, we get no new dependencies.

The collection of 11 new dependencies mentioned above is: C->A, AB->D, AC->D, BC->A, BC->D, BD->A, BD->C, CD->A, ABC->D, ABD->C, and BCD->A. Exercise 3.5.1(b)

From the analysis of closures above, we find that AB, BC, and BD are keys. All other sets either do not have ABCD as the closure or contain one of these three sets.

Exercise 3.5.1(c)

The superkeys are all those that contain one of those three keys. That is, a superkey that is not a key must contain B and more than one of A, C, and D. Thus, the (proper) superkeys are ABC, ABD, BCD, and ABCD.

Exercise 3.5.3(a)

We must compute the closure of A1A2...AnC. Since A1A2...An->B is a dependency, surely B is in this set, proving A1A2...AnC->B.

Exercise 3.5.4(a)

Consider the relation

Exercise 3.5.8(a)

If all sets of attributes are closed, then there cannot be any nontrivial functional dependencies. For suppose A1A2...An->B is a nontrivial dependency. Then A1A2...An+ contains B and thus A1A2...An is not closed.

Exercise 3.5.10(a)

We need to compute the closures of all subsets of {ABC}, although there is no need to think about the empty set or the set of all three attributes. Here are the

calculations for the remaining six sets:

A+ = A

B+ = B

C+ = ACE

AB+ = ABCDE

AC+ = ACE

BC+ = ABCDE

We ignore D and E, so a basis for the resulting functional dependencies for ABC are: C->A and AB->C. Note that BC->A is true, but follows logically from C->A, and therefore may be omitted from our list.

Solutions for Section 3.6

Exercise 3.6.1(a)

In the solution to Exercise 3.5.1 we found that there are 14 nontrivial dependencies, including the three given ones and 11 derived dependencies. These are: C->A, C->D, D->A, AB->D, AB-> C, AC->D, BC->A, BC->D, BD->A, BD->C, CD->A, ABC->D, ABD->C, and BCD->A.

We also learned that the three keys were AB, BC, and BD. Thus, any dependency above that does not have one of these pairs on the left is a BCNF violation. These are: C->A, C->D, D->A, AC->D, and CD->A.

One choice is to decompose using C->D. That gives us ABC and CD as decomposed relations. CD is surely in BCNF, since any two-attribute relation is. ABC is not in BCNF, since AB and BC are its only keys, but C->A is a dependency that holds in ABCD and therefore holds in ABC. We must further decompose ABC into AC and BC. Thus, the three relations of the decomposition are AC, BC, and CD.

Since all attributes are in at least one key of ABCD, that relation is already in 3NF, and no decomposition is necessary.

Exercise 3.6.1(b)

(Revised 1/19/02) The only key is AB. Thus, B->C and B->D are both BCNF violations. The derived FD's BD->C and BC->D are also BCNF violations. However, any other nontrivial, derived FD will have A and B on the left, and therefore will contain a key.

One possible BCNF decomposition is AB and BCD. It is obtained starting with any of the four violations mentioned above. AB is the only key for AB, and B is the only key for BCD.

Since there is only one key for ABCD, the 3NF violations are the same, and so is the decomposition.

Solutions for Section 3.7

Exercise 3.7.1

Since A->->B, and all the tuples have the same value for attribute A, we can pair the B-value from any tuple with the value of the remaining attribute C from any other tuple. Thus, we know that R must have at least the nine tuples of the form (a,b,c), where b is any of b1, b2, or b3, and c is any of c1, c2, or c3. That is, we can derive, using the definition of a multivalued dependency, that each of the tuples (a,b1,c2), (a,b1,c3), (a,b2,c1), (a,b2,c3), (a,b3,c1), and (a,b3,c2) are also in R. Exercise 3.7.2(a)

First, people have unique Social Security numbers and unique birthdates. Thus, we expect the functional dependencies ssNo->name and ssNo->birthdate hold. The same applies to children, so we expect childSSNo->childname and childSSNo->childBirthdate. Finally, an automobile has a unique brand, so we expect autoSerialNo->autoMake.

There are two multivalued dependencies that do not follow from these functional dependencies. First, the information about one child of a person is independent of other information about that person. That is, if a person with social security number s has a tuple with,cs,cb, then if there is any other tuple t for the same person, there will also be another tuple that agrees with t except that it has,cs,cb in its components for the child name, Social Security number, and birthdate. That is the multivalued dependency

ssNo->->childSSNo childName childBirthdate

Similarly, an automobile serial number and make are independent of any of the other attributes, so we expect the multivalued dependency

ssNo->->autoSerialNo autoMake

The dependencies are summarized below:

ssNo -> name birthdate

childSSNo -> childName childBirthdate

autoSerialNo -> autoMake

ssNo ->-> childSSNo childName childBirthdate

ssNo ->-> autoSerialNo autoMake

Exercise 3.7.2(b)

We suggest the relation schemas

{ssNo, name, birthdate}

{ssNo, childSSNo}

{childSSNo, childName childBirthdate}

{ssNo, autoSerialNo}

{autoSerialNo, autoMake}

An initial decomposition based on the two multivalued dependencies would give us

{ssNo, name, birthDate}

{ssNo, childSSNo, childName, childBirthdate}

{ssNo, autoSerialNo, autoMake}

Functional dependencies force us to decompose the second and third of these.

数据库系统基础教程(第二版)课后习题答案

Database Systems: The Complete Book Solutions for Chapter 2 Solutions for Section 2.1 Exercise 2.1.1 The E/R Diagram. Exercise 2.1.8(a) The E/R Diagram Kobvxybz Solutions for Section 2.2 Exercise 2.2.1 The Addresses entity set is nothing but a single address, so we would prefer to make address an attribute of Customers. Were the bank to record several addresses for a customer, then it might make sense to have an Addresses entity set and make Lives-at a many-many relationship. The Acct-Sets entity set is useless. Each customer has a unique account set containing his or her accounts. However, relating customers directly to their accounts in a many-many relationship conveys the same information and eliminates the account-set concept altogether. Solutions for Section 2.3 Exercise 2.3.1(a) Keys ssNo and number are appropriate for Customers and Accounts, respectively. Also, we think it does not make sense for an account to be related to zero customers, so we should round the edge connecting Owns to Customers. It does not seem inappropriate to have a customer with 0 accounts;

数据库应用基础教程答案

数据库应用基础教程答案 【篇一:access数据库应用基础教程(第三版)习题及答 案】 txt>程(第三版)习题集答案 第1章数据库系统概述 1. 什么是数据库?什么是数据库系统?答:数据库(database) 是存放数据的仓库,严格的讲,数据库是长期存储在计算机内,有组 织的,可共享的大量数据集合。 数据库系统(database systems),是由数据库及其管理软件组成的系统。它是为适应数据处理的需要而发展起来的一种较为理想的 数据处理的核心机构。它是一个实际可运行的存储、维护和应用系 统提供数据的软件系统,是存储介质、处理对象和管理系统的集合体。 2. 什么是数据库管理系统?它有哪些主要功能? 答:数据库管理系统(database management system)是一种操纵 和管理数据 库的大型软件,用于建立、使用和维护数据库,简称dbms。它对数据库进行统一的管理和控制,以保证数据库的安全性和完整性。 数据库管理系统的主要功能有:数据定义、数据操作、数据库的运 行管理、数据组织、数据库的保护、数据库的维护和通信。 3. 说出几种常用的数据模型。 答:层次模型、网状模型、关系模型。 4. 什么是关系模型? 答:关系模型是用二维表的形式表示实体和实体间联系的数据模型。 5. 简述数据库设计的步骤。 答:需求分析、概念结构设计、逻辑结构设计、物理结构设计、数 据库的建立和测试、数据库运行和维护。 第2章 sql 语言简介 1. 什么是sql语言?sql语言具有哪些特点和功能? 答:sql是一种数据库查询和程序设计语言,用于存取数据以及查询更新和管理关系 数据库系统。 sql的特点和功能有:查询,操作,定义和控制四个方面,sql语言 具有高度的非过程化,语言简洁,语义明显,语法结构简单,直观

数据库基础教程CH1 答案

Exercises 2.3.1 In this exercise we introduce one of our running examples of a relational database schema. The database schema consists of four relations, whose schemas are: Product (maker, model, type) PC (model, speed, ram. hd, price) Laptop (model, speed, ram, hd, screen, price) Printer (model, color, type, price) The Product relation gives the manufacturer, model number and type (PC, laptop, or printer) of various products. We assume for convenience that model numbers are unique over all manufacturers and product types; that assumption is not realistic, and a real database would include a code for the manufacturer as part of the model number. The PC relation gives for each model number that is a PC the speed (of the processor, in gigahertz), the amount of RAM (in megabytes), the size of the hard disk (in gigabytes), and the price. The Laptop relation is similar, except that the screen size (in inches) is also included. The Printer relation records for each printer model whether the printer produces color output (true, if so), the process type (laser or ink-jet, typically), and the price. Write the following declarations: a) A suitable schema for relation Product. b) A suitable schema for relation PC. c) A suitable schema for relation Laptop. d) A suitable schema for relation Printer. e)An alteration to your Printer schema from (d) to delete the attribute color. f)An alteration to your Laptop schema from (c) to add the attribute od (optical-disk type, e.g., cd or dvd). Let the default value for this attribute be 'none' if the laptop does not have an optical disk. Exercise 2.3.1a CREATE TABLE Product ( maker CHAR(30), model CHAR(10) PRIMARY KEY, type CHAR(15) ); Exercise 2.3.1b CREATE TABLE PC ( model CHAR(30), speed DECIMAL(4,2), ram INTEGER, hd INTEGER, price DECIMAL(7,2) );

操作系统教程_孙钟秀(第四版)课后习题答案

首页入门学 习 程序 员 计算机考 研 计算机电子书 下载 硬件知 识 网络知 识 专业课程答案 下载 视频教程下载 第一章 作者:佚名来源:网络 1、有一台计算机,具有IMB 内存,操作系统占用200KB ,每个用户进程各占200KB 。如果用户进程等待I/O 的时间为80 % ,若增加1MB 内存,则CPU 的利用率提高多少? 答:设每个进程等待I/O 的百分比为P ,则n 个进程同时等待刀O 的概率是Pn ,当n 个进程同时等待I/O 期间CPU 是空闲的,故CPU 的利用率为1-Pn。由题意可知,除去操作系统,内存还能容纳4 个用户进程,由于每个用户进程等待I/O的时间为80 % , 故: CPU利用率=l-(80%)4 = 0.59 若再增加1MB 内存,系统中可同时运行9 个用户进程,此时:cPu 利用率=l-(1-80%)9 = 0.87 故增加IMB 内存使CPU 的利用率提高了47 % : 87 %/59 %=147 % 147 %-100 % = 47 % 2 一个计算机系统,有一台输入机和一台打印机,现有两道程序投入运行,且程序A 先开始做,程序B 后开始运行。程序A 的运行轨迹为:计算50ms 、打印100ms 、再计算50ms 、打印100ms ,结束。程序B 的运行轨迹为:计算50ms 、输入80ms 、再计算100ms ,结束。试说明(1 )两道程序运行时,CPU有无空闲等待?若有,在哪段时间内等待?为什么会等待?( 2 )程序A 、B 有无等待CPU 的情况?若有,指出发生等待的时刻。 答:画出两道程序并发执行图如下: (1)两道程序运行期间,CPU存在空闲等待,时间为100 至150ms 之间(见图

南京理工大学《数据库系统基础教程》试题和答案

一、选择题60(选择一个最合适的答案,在答题纸上涂黑) 1.一个事务中的一组更新操作是一个整体,要么全部执行,要么全部不执行。这是事务的:A.原子性B.一致性 C.隔离性 D.持久性 2.在数据库的三级模式结构中,描述一个数据库中全体数据的全局逻辑结构和特性的是:A.外模式 B.模式 C.存储模式D.模式 3.关于联系的多重性,下面哪种说法不正确? A.一个多对多的联系中允许多对一的情形。 B.一个多对多的联系中允许一对一的情形。 C.一个多对一的联系中允许一对一的情形。 D.一个多对一的联系中允许多对多的情形。 4.考虑学校里的"学生"和"课程"之间的联系,该联系的多重性应该是: A. 一对一 B. 多对一 C. 一对多 D. 多对多 5.下面哪种约束要求一组属性在同一实体集任意两个不同实体上的取值不同。 A. 键(key)约束。 B. 单值约束。 C. 参照完整性。 D. 域(domain)约束 6.关系模型要求各元组的每个分量的值必须是原子性的。对原子性,下面哪种解释不正确:A.每个属性都没有部结构。 B.每个属性都不可再分解。 C.各属性值应属于某种基本数据类型。 D.属性值不允许为NULL。 7.对于一个关系的属性(列)集合和元组(行)集合,下面哪种说法不正确: A.改变属性的排列次序不影响该关系。 B.改变元组的排列次序不影响该关系。 C.改变元组的排列次序会改变该关系。 D.关系的模式包括其名称及其属性集合。 8.若R是实体集R1与R2间的一个多对多联系,将其转换为关系R',哪种说法不正确:A.R'属性应包括R1与R2的所有属性。 B.R'属性应包括R1与R2的键属性。 C.R1与R2的键属性共同构成R'的键。 D.R'的属性应包括R自身定义的属性。 9.关于函数依赖的判断,下面哪种说法不正确? A.若任意两元组在属性A上一致,在B上也一致,则有A → B成立。 B.若任意两元组在属性A上一致,在B上不一致,则A → B不成立。 C.若任意两元组在属性A上不可能一致,则不管在B上是否一致,有A → B成立。

Access数据库应用基础教程(第三版)习题及答案

Access数据库应用基础教程(第三版)习题集答案 第1章数据库系统概述 1. 什么是数据库?什么是数据库系统?答:数据库(database)是存放数据的仓库,严格的讲,数据库是长期存储在计算机内,有组织的,可共享的大量数据集合。 数据库系统(database systems),是由数据库及其管理软件组成的系统。它是为适应数据处理的需要而发展起来的一种较为理想的数据处理的核心机构。它是一个实际可运行的存储、维护和应用系统提供数据的软件系统,是存储介质、处理对象和管理系统的集合体。 2. 什么是数据库管理系统?它有哪些主要功能? 答:数据库管理系统(database management system)是一种操纵和管理数据

库的大型软件,用于建立、使用和维护数据库,简称dbms。它对数据库进行统一的管理和控制,以保证数据库的安全性和完整性。数据库管理系统的主要功能有:数据定义、数据操作、数据库的运行管理、数据组织、数据库的保护、数据库的维护和通信。 3. 说出几种常用的数据模型。 答:层次模型、网状模型、关系模型。4. 什么是关系模型? 答:关系模型是用二维表的形式表示实体和实体间联系的数据模型。 5. 简述数据库设计的步骤。 答:需求分析、概念结构设计、逻辑结构设计、物理结构设计、数据库的建立和测试、数据库运行和维护。 第2章 SQL 语言简介 1. 什么是SQL语言?SQL语言具有哪些特点和功能? 答:SQL是一种数据库查询和程序设计语言,用于存取数据以及查询更新和管理关系

数据库系统。 SQL的特点和功能有:查询,操作,定义和控制四个方面,SQL语言具有高度的非过程化,语言简洁,语义明显,语法结构简单,直观易懂的特点。SQL语言即可以作为独立语言使用,用户可以在终端键盘上直接键入SQL命令对数据库进行操作,也可以作为嵌入式语言,嵌入到其他高级语言中。 2. SQL语言包含哪几个部分? 答:SQL语言包含4个部分:数据定义语言(DDL-Data Definition Language)、数据查询语言(DQL-Data Query Language)、数据操纵语言(DML-Data Manipulation Language)、数据控制语言(DCL-Data Control Language) 3. 在联接查询中,包含哪几类联接?答:联接可分为3类: (1)内部联接(典型的联接运算,使用类似于 = 或 <> 的比较运算符)。内部联接使用比较运算符根据每个表的通用列中的值匹配两个表中的行。内部联接包括同等

操作系统》第章教材习题解答

第4章存储管理 “练习与思考”解答 1.基本概念和术语 逻辑地址、物理地址、逻辑地址空间、内存空间、重定位、静态重定位、动态重定位、碎片、碎片紧缩、虚拟存储器、快表、页面抖动 用户程序经编译之后的每个目标模块都以0为基地址顺序编址,这种地址称为相对地址或逻辑地址。 内存中各物理存储单元的地址是从统一的基地址开始顺序编址的,这种地址称为绝对地址或物理地址。 由程序中逻辑地址组成的地址范围叫做逻辑地址空间,或简称为地址空间。 由内存中一系列存储单元所限定的地址范围称作内存空间,也称物理空间或绝对空间。 程序和数据装入内存时,需对目标程序中的地址进行修改。这种把逻辑地址转变为内存物理地址的过程称作重定位。 静态重定位是在目标程序装入内存时,由装入程序对目标程序中的指令和数据的地址进行修改,即把程序的逻辑地址都改成实际的内存地址。 动态重定位是在程序执行期间,每次访问内存之前进行重定位。这种变换是靠硬件地址转换机构实现的。 内存中这种容量太小、无法被利用的小分区称作“碎片”或“零头”。 为解决碎片问题,移动某些已分配区的内容,使所有进程的分区紧挨在一起,而把空闲区留在另一端。这种技术称为紧缩(或叫拼凑)。 虚拟存储器是用户能作为可编址内存对待的虚拟存储空间,它使用户逻辑存储器与物理存储器分离,是操作系统给用户提供的一个比真实内存空间大得多的地址空间。 为了解决在内存中放置页表带来存取速度下降的矛盾,可以使用专用的、高速小容量的联想存储器,也称作快表。 若采用的置换算法不合适,可能出现这样的现象:刚被换出的页,很快又被访问,为把它调入而换出另一页,之后又访问刚被换出的页,……如此频繁地更换页面,以致系统的大部分时间花费在页面的调度和传输上。此时,系统好像很忙,但实际效率却很低。这种现象称为“抖动”。 2.基本原理和技术 (1)存储器一般分为哪些层次?各有何特性? 存储器一般分为寄存器、高速缓存、内存、磁盘和磁带。 CPU内部寄存器,其速度与CPU一样快,但它的成本高,容量小。 高速缓存(Cache),它们大多由硬件控制。Cache的速度很快,它们放在CPU内部或非常靠近CPU的地方。但Cache的成本很高,容量较小。 内存(或称主存),它是存储器系统的主力,也称作RAM(随机存取存储器)。CPU可以直接存取内存及寄存器和Cache中的信息。然而,内存中存放的信息是易变的,当机器电源被关闭后,内存中的信息就全部丢失了。 磁盘(即硬盘),称作辅助存储器(简称辅存或外存),它是对内存的扩展,但是CPU不能直接存取磁盘上的数据。磁盘上可以永久保留数据,而且容量特别大。磁盘上数据的存取速度低于内存存取速度。 磁带保存的数据更持久,容量更大,但它的存取速度很慢,而且不适宜进行随机存取。所以,磁带设备一般不能用做辅存。它的主要用途是作为文件系统的后备,存放不常用的信息或用做系统间传送信息的介质。 (2)装入程序的功能是什么?常用的装入方式有哪几种? 装入程序的功能是根据内存的使用情况和分配策略,将装入模块放入分配到的内存区中。 程序装入内存的方式有三种,分别是绝对装入方式、可重定位装入方式和动态运行时装入方式。

数据库技术与应用(第二版)课后答案

第1章习题参考答案 1.思考题 (1)什么是数据库、数据库管理系统、数据库系统?它们之间有什么联系? 答:数据库是存贮在计算机的有结构的数据集合;数据库管理系统是一个软件,用以维护数据库、接受并完成用户对数据库的一切操作;数据库系统指由硬件设备、软件系统、专业领域的数据体和管理人员构成的一个运行系统。 (2)当前,主要有哪几种新型数据库系统?它们各有什么特点?用于什么领域,试举例说明?答:主要有:分布式数据库、面向对象数据库、多媒体数据库、数据仓库技术、空间数据库。 (3)什么是数据模型?目前数据库主要有哪几种数据模型?它们各有什么特点? 答:数据模型是一组描述数据库的概念。这些概念精确地描述数据、数据之间的关系、数据的语义和完整性约束。很多数据模型还包括一个操作集合。这些操作用来说明对数据库的存取和更新。数据模型应满足3方面要求:一是能真实地模拟现实世界;二是容易为人们理解;三是便于在计算机上实现。目前在数据库领域,常用的数据模型有:层次模型、网络模型、关系模型以及最近兴起的面向对象的模型。 (4)关系数据库中选择、投影、连接运算的含义是什么? 答: 1)选择运算:从关系中筛选出满足给定条件的元组(记录)。选择是从行的角度进行运算,选择出的记录是原关系的子集。 2)投影运算:从关系中指定若干个属性(字段)组成新的关系。投影是从列的角度进行运算,得到的新关系中的字段个数往往比原关系少。 3)连接运算:将两个关系按照给定的条件横向拼接成新的关系。连接过程是通过两个关系中公有的字段名进行的。 (5)关键字段的含义是什么?它的作用是什么? 答:一个关系中可以确定一个字段为关键字段,该字段的值在各条记录中不能有相同的值。(如:门牌);关键字段的作用主要是为建立多个表的关联和进行快速查询。 (6)什么是E-R图?E-R 图是由哪几种基本要素组成?这些要素如何表示? 答:E-R图也称实体-联系图(Entity Relationship Diagram),提供了表示实体类型、属性和联系的方法,用来描述现实世界的概念模型。构成E-R图的基本要素有3种,即实体、属性和联系。其表示方法为:用矩形框表示现实世界中的实体,用菱形框表示实体间的联系,用椭圆形框表示实体和联系的属性,实体名、属性名和联系名分别写在相应框。 ABAAC ABCAA 第2章习题解答 1. 思考题 (1)在SQL Server 2008中的数据库中包含哪些对象?其中什么对象是必不可少的?其作用又是什么? 答:SQL Server 2008中的数据库对象主要包括数据库关系图、表、视图、同义词、可编程性、Service Broker、存储和安全性等。其中表对象是必不可少的。表是由行和列构成的集合,用来存储数据。 (2)SQL Server提供的系统数据库master它的作用是什么?用户可以删除和修改吗?为什么?答:master 数据库记录SQL Server 系统的所有系统级信息。主要包括实例围的元数据、端点、服务器和系统配置设置以及记录了所有其他数据库的存在、数据库文件的

计算机操作系统教程课后答案

第一章绪论 1.什么是操作系统的基本功能? 答:操作系统的职能是管理和控制汁算机系统中的所有硬、软件资源,合理地组织计算 机工作流程,并为用户提供一个良好的工作环境和友好的接口。操作系统的基本功能包括: 处理机管理、存储管理、设备管理、信息管理(文件系统管理)和用户接口等。 2.什么是批处理、分时和实时系统?各有什么特征? 答:批处理系统(batchprocessingsystem):操作员把用户提交的作业分类,把一批作业编成一个作业执行序列,由专门编制的监督程序(monitor)自动依次处理。其主要特征是:用户脱机使用计算机、成批处理、多道程序运行。 分时系统(timesharingoperationsystem):把处理机的运行时间分成很短的时间片,按时间片轮转的方式,把处理机分配给各进程使用。其主要特征是:交互性、多用户同时性、独立性。 实时系统(realtimesystem):在被控对象允许时间范围内作出响应。其主要特征是:对实时信息分析处理速度要比进入系统快、要求安全可靠、资源利用率低。 3.多道程序(multiprogramming)和多重处理(multiprocessing)有何区别? 答;多道程序(multiprogramming)是作业之间自动调度执行、共享系统资源,并不是真正地同时执行多个作业;而多重处理(multiprocessing)系统配置多个CPU,能真正同时执行多道程序。要有效使用多重处理,必须采用多道程序设计技术,而多道程序设计原则上不一定要求多重处理系统的支持。 4.讨论操作系统可以从哪些角度出发,如何把它们统一起来? 答:讨论操作系统可以从以下角度出发: (1)操作系统是计算机资源的管理者; (2)操作系统为用户提供使用计算机的界面; (3)用进程管理观点研究操作系统,即围绕进程运行过程来讨论操作系统。

数据库系统基础教程(第二版)课后习题答案2

Database Systems: The Complete Book Solutions for Chapter 2 Solutions for Section 2.1 Exercise 2.1.1 The E/R Diagram. Exercise 2.1.8(a) The E/R Diagram Kobvxybz Solutions for Section 2.2 Exercise 2.2.1 The Addresses entity set is nothing but a single address, so we would prefer to make address an attribute of Customers. Were the bank to record several addresses for a customer, then it might make sense to have an Addresses entity set and make Lives-at a many-many relationship. The Acct-Sets entity set is useless. Each customer has a unique account set containing his or her accounts. However, relating customers directly to their accounts in a many-many relationship conveys the same information and eliminates the account-set concept altogether. Solutions for Section 2.3 Exercise 2.3.1(a) Keys ssNo and number are appropriate for Customers and Accounts, respectively. Also, we think it does not make sense for an account to be related to zero customers, so we should round the edge connecting Owns to Customers. It does not seem inappropriate to have a customer with 0 accounts;

操作系统教程习题答案

《操作系统教程》习题答案

习题1 1.单项选择题 (1)大中小型计算机是以为中心的计算机系统。 A、CPU B、存储器 C、系统总线 D、通道 (2)以下关于操作系统的说法正确的是。 A、批处理系统是实现人机交互的系统 B、批处理系统具有批处理功能,但不具有交互能力 C、分时系统是实现自动控制,无须人为干预的系统 D、分时系统即具有分时交互能力,又具有批处理能力 (3)操作系统的职能是管理软硬件资源、合理地组织计算机工作流程和。 A、为用户提供良好的工作环境和接口 B、对用户的命令作出快速响应 C、作为服务机构向其它站点提供优质服务 D、防止有人以非法手段进入系统 (4)设计实时操作系统时,首先应考虑系统的。 A、可靠性和灵活性 B、实时性和可靠性 C、优良性和分配性 D、灵活性和分配性 (5)多道程序设计是指。 A、在分布式系统中同一时刻运行多个程序 B、在一台处理器上并行运行多个程序 C、在实时系统中并发运行多个程序 D、在一台处理器上并发运行多个程序 (6)以下关于并发性和并行性的说法正确的是。 A、并发性是指两个及多个事件在同一时刻发生 B、并发性是指两个及多个事件在同一时间间隔内发生 C、并行性是指两个及多个事件在同一时间间隔内发生 D、并发性是指进程,并行性是指程序 (1)B (2)B (3)A (4)B (5)D (6)B 2.填空题 (1)微机是以总线为纽带构成的计算机系统。 (2)在批处理兼分时系统中,往往把由分时系统控制的作业称为前台作业,把由批处理系统控制的作业称为后台作业。 (3)在分时系统中,若时间片长度一定,则用户数越多,系统响应时间越慢。 (4)分布式操作系统能使系统中若干台计算机协同完成一个共同的任务,分解问题成为子计算并使之在系统中各台计算机上并行执行,以充分利用各计算机的优势。 (5)用户通过网络操作系统可以网络通信、资源共享,从而大大扩展了计算机的应用范围。 3.简答题 (1)什么是操作系统?现代操作系统的基本特征是什么?并发性 (2)什么是批处理系统,衡量批处理系统好坏的主要指标是什么?及时性 (3)试述分时系统的原理及其特性。时间片原则交互性同时性独立性及时性

数据库原理及应用(第2版)习题参考答案..

第1章数据概述 一.选择题 1.下列关于数据库管理系统的说法,错误的是C A.数据库管理系统与操作系统有关,操作系统的类型决定了能够运行的数据库管理系统的类型 B.数据库管理系统对数据库文件的访问必须经过操作系统实现才能实现 C.数据库应用程序可以不经过数据库管理系统而直接读取数据库文件 D.数据库管理系统对用户隐藏了数据库文件的存放位置和文件名 2.下列关于用文件管理数据的说法,错误的是D A.用文件管理数据,难以提供应用程序对数据的独立性 B.当存储数据的文件名发生变化时,必须修改访问数据文件的应用程序 C.用文件存储数据的方式难以实现数据访问的安全控制 D.将相关的数据存储在一个文件中,有利于用户对数据进行分类,因此也可以加快用户操作数据的效率 3.下列说法中,不属于数据库管理系统特征的是C A.提供了应用程序和数据的独立性 B.所有的数据作为一个整体考虑,因此是相互关联的数据的集合 C.用户访问数据时,需要知道存储数据的文件的物理信息 D.能够保证数据库数据的可靠性,即使在存储数据的硬盘出现故障时,也能防止数据丢失 5.在数据库系统中,数据库管理系统和操作系统之间的关系是D A.相互调用 B.数据库管理系统调用操作系统 C.操作系统调用数据库管理系统 D.并发运行 6.数据库系统的物理独立性是指D A.不会因为数据的变化而影响应用程序 B.不会因为数据存储结构的变化而影响应用程序 C.不会因为数据存储策略的变化而影响数据的存储结构 D.不会因为数据逻辑结构的变化而影响应用程序 7.数据库管理系统是数据库系统的核心,它负责有效地组织、存储和管理数据,它位于用户和操作系统之间,属于A A.系统软件B.工具软件 C.应用软件D.数据软件 8.数据库系统是由若干部分组成的。下列不属于数据库系统组成部分的是B A.数据库B.操作系统 C.应用程序D.数据库管理系统 9.下列关于客户/服务器结构和文件服务器结构的描述,错误的是D A.客户/服务器结构将数据库存储在服务器端,文件服务器结构将数据存储在客户端 B.客户/服务器结构返回给客户端的是处理后的结果数据,文件服务器结构返回给客户端的是包含客户所需数据的文件 C.客户/服务器结构比文件服务器结构的网络开销小 D.客户/服务器结构可以提供数据共享功能,而用文件服务器结构存储的数据不能共享

操作系统教程第5版部分习题标准答案

第一章: 一、3、10、15、23、27、35 3.什么是操作系统?操作系统在计算机系统中的主要作用是什么? 操作系统是管理系统资源、控制程序执行、改善人机界面、提供各种服务,并合理组织计算机工作流程和为用户有效地使用计算机提供良好运行环境的一种系统软件. 主要作用 (1)服务用户—操作系统作为用户接口和公共服务程序 (2)进程交互—操作系统作为进程执行的控制者和协调者 (3)系统实现—操作系统作为扩展机或虚拟机 (4)资源管理—操作系统作为资源的管理者和控制者 10.试述系统调用与函数(过程)调用之间的区别。 (1)调用形式和实现方式不同; (2)被调用的代码位置不同; (3)提供方式不同 15.什么是多道程序设计?多道程序设计有什么特点? 多道程序设计是指允许多个作业(程序)同时进入计算机系统内存并执行交替计算的方法。从宏观上看是并行的,从微观上看是串行的。 (1)可以提高CPU、内存和设备的利用率; (2)可以提高系统的吞吐率,使单位时间内完成的作业数目增加; (3)可以充分发挥系统的并行性,使设备和设备之间,设备和CPU之间均可并行工作。 23.现代操作系统具有哪些基本功能?请简单叙述之。 (1)处理器管理; (2)存储管理; (3)设备管理; (4)文件管理; (5)联网与通信管理。 27.什么是操作系统的内核? 内核是一组程序模块,作为可信软件来提供支持进程并发执行的基本功能和基本操作,通常驻留在内核空间,运行于内核态,具有直接访问计算机系统硬件设备和所有内存空间的权限,是仅有的能够执行特权指令的程序。 35.简述操作系统资源管理的资源复用技术。

系统中相应地有多个进程竞争使用资源,由于计算机系统的物理资源是宝贵和稀有的,操作系统让众多进程共享物理资源,这种共享称为资源复用。 (1)时分复用共享资源从时间上分割成更小的单位供进程使用; (2)空分复用共享资源从空间上分割成更小的单位供进程使用。 . 二、2、5 2、答:画出两道程序并发执行图如下: (1) (见图中有色部分)。 (2)程序A无等待现象,但程序B有等待。程序B有等待时间段为180ms至200ms间(见 图中有色部分)。 5、答:画出三个作业并行工作图如下(图中着色部分为作业等待时间):

数据库系统基础教程课后答案第五章

Exercise 5.1.1 As a set: Average = 2.37 As a bag: Average = 2.48 Exercise 5.1.2 As a set:

Average = 218 As a bag: Average = 215 Exercise 5.1.3a As a set:

As a bag: Exercise 5.1.3b πbore(Ships Classes) Exercise 5.1.4a For bags: On the left-hand side: Given bags R and S where a tuple t appears n and m times respectively, the union of bags R and S will have tuple t appear n + m times. The further union of bag T with the tuple t appearing o times will have tuple t appear n + m + o times in the final result. On the right-hand side: Given bags S and T where a tuple t appears m and o times respectively, the union of bags R and S will have tuple t appear m + o times. The further union of bag R with the tuple t appearing n times will have tuple t appear m + o + n times in the final result. For sets: This is a similar case when dealing with bags except the tuple t can only appear at most once in each set. The tuple t only appears in the result if all the sets have the tuple t. Otherwise, the tuple t will not appear in the result. Since we cannot have duplicates, the result only has at most one copy of the tuple t. Exercise 5.1.4b For bags: On the left-hand side:

数据库基础教程课后习题答案顾韵华

习题1 1、简述数据库系统的特点。 答:数据库系统的特点有: 1)数据结构化 在数据库系统中,采用统一的数据模型,将整个组织的数据组织为一个整体;数据不再仅面向特定应用,而是面向全组织的;不仅数据内部是结构化的,而且整体是结构化的,能较好地反映现实世界中各实体间的联系。这种整体结构化有利于实现数据共享,保证数据和应用程序之间的独立性。 2)数据共享性高、冗余度低、易于扩充 数据库中的数据能够被多个用户、多个应用程序共享。数据库中相同的数据不会多次重复出现,数据冗余度降低,并可避免由于数据冗余度大而带来的数据冲突问题。同时,当应用需求发生改变或增加时,只需重新选择不同的子集,或增加数据即可满足。 3)数据独立性高 数据独立性是由DBMS 的二级映像功能来保证的。数据独立于应用程序,降低了应用程序的维护成本。 4)数据统一管理与控制 数据库中的数据由数据库管理系统(DBMS )统一管理与控制,应用程序对数据的访问均经由DBMS 。DBMS 提供四个方面的数据控制功能:并发访问控制、数据完整性、数据安全性保护、数据库恢复。 2、什么是数据库系统? 答:在计算机系统上引入数据库技术就构成一个数据库系统(DataBase System ,DBS )。数据库系统是指带有数据库并利用数据库技术进行数据管理的计算机系统。DBS 有两个基本要素:一是DBS 首先是一个计算机系统;二是该系统的目标是存储数据并支持用户查询和更新所需要的数据。 3、简述数据库系统的组成。 答:数据库系统一般由数据库、数据库管理系统(及其开发工具)、数据库管理员(DataBase Administrator ,DBA )和用户组成。 4、试述数据库系统的三级模式结构。这种结构的优点是什么? 答:数据库系统的三级模式结构是指数据库系统是由外模式、模式和内模式三级构成,同时包含了二级映像,即外模式/模式映像、模式/内模式映像,如下图所示。 数据库应用1…… 外模式A 外模式B 模式 应用2应用3应用4应用5…… 模式 外模式/模式映像 模式/内模式映像 数据库系统的这种结构具有以下优点: (1)保证数据独立性。将外模式与模式分开,保证了数据的逻辑独立性;将内模式与模式分开,保证了数据的物理独立性。 (2)有利于数据共享,减少了数据冗余。 (3)有利于数据的安全性。不同的用户在各自的外模式下根据要求操作数据,只能对

SQLServer2008数据库应用教程课后答案

第1章数据库基础 一、单项选择题 1.C 2.A 3.C 4.D 5.D 6.B 7.A 8.B 9.B 10.D 11.C 12.A 13.C 14.B 15.A 16.B 17.A 18.D 19.B 20.B 21.A; D 22.A 23.C 24.D 25.B 26.B 27.B 28.D 29.B 30.B 二、填空题 1.概念;数据 2.属性 3.码 4.一对一联系;一对多(或多对一)联系;多对多联系 5.候选码 6.候选码 7.关系名(属性1,属性2,…,属性n) 8.关系数据结构;关系操作集合;关系完整性约束 9.实体;参照;用户定义的;实体;参照 10.空植 11.需求分析阶段;概念结构设计阶段;逻辑结构设计阶段;物理结构设计阶段;数据库实施阶段;数据库运行和维护阶段 12.准确了解并分析用户对系统的要求,尤其是用户的信息要求、处理要求、安全性与完整性要求,确定所要开发的应用系统的目标,产生用户和设计者都能接受的需求说明书,做为下一步数据库概念结构设计的基础。 13.将需求分析得到的用户需求抽象为信息结构即概念模型。 14.将概念结构进一步转化为某一DBMS支持的数据模型,并对其进行优化。 15.为逻辑数据模型选取一个最适合应用环境的物理结构,包括数据库在物理设备上的存储结构和存取方法。 三、指出以下各缩写的英文意思和中文意思 1.DB:DataBase 2.DBMS:Database Management System 3.RDBMS: 4.DBS:DataBase System 5.DBA:Relational Database Management System 6.NF:Normal Form 7.DDL:Data Definition Language 四、按题目要求回答问题

Oracle11g数据库基础教程-参考答案

Oracle11g数据库基础教程 参考答案

第1章Oracle 11g数据库安装与配置1.简答题 (1) 企业版数据库服务器包含所有的数据库组件,主要针对高端的应用环境,适用于安全性和性能要求较高的联机事务处理(OLTP)、查询密集型的数据仓库和要求较高的Internet应用程序:标准版数据库服务器提供大部分核心的数据库功能和特性,适合于工作组或部门级的应用程序:个人版数据库服务器只提供基本数据库管理功能和特性,适合单用户的开发环境,为用户提供开发测试平台。 (2) 常用数据库类型包括事务处理类、数据仓库类以通用类型。其中事务处理类型主要针对具有大量并发用户连接,并且用户主要执行简单事务处理的应用环境。事务处理数据库的典型应用有银行系统数据库、Internet电子商务数据库、证券交易系统数据库等。对于需要较高的可用性和事务处理性能、存在大量用户并行访问相同数据以及需要较高恢复性能的数据库环境,事务处理类型的配置可以提供最佳性能;数据仓库类型的数据库主要针对有大量的对某个主题进行复杂查询的应用环境。数据仓库的典型应用有客户订单研究、支持呼叫、销售预测、采购模式以及其他战略性业务问题的历史数据研究。对于需要对大量数据进行快速访问,以及复杂查询的数据库环境,数据仓库类型配置是最佳选择;通用类型配置的数据库是事务处理数据库与数据仓库配置的折衷方案。既可以支持大量并发用户的事务处理,又可以快速对大量历史数据进行复杂的数据扫描和处理。 (3) 数据库名可以由字母、数字、下划线(_)、#和美元符号($)组成,且必须以字母开头,长度不超过30个字符。在单机环境中,可以不设置域名,域名长度不能超过128个字符。Oracle服务标识符(SID)是一个Oracle实例的唯一名称标识,长度不能超过12个字符。(4) ● OracleServiceORCL:数据库服务(数据库实例),是Oracle核心服务,是数据库启 动的基础,只有该服务启动,Oracle数据库才能正常启动。(必须启动) ● OracleOraDb11g_home1TNSListener:监听器服务,该服务只有在远程访问数据库时 才需要(无论远程计算机还是本地计算机,凡是通过Oracle Net网络协议连接数据库都属于远程访问)。(必须启动) ● OracleOraDb11g_home1ConfigurationManager:配置Oracle启动时的参数的服务。(非 必须启动) ● OracleOraDb11g_home1ClrAgent:提供对.NET支持的Oracle数据库扩展服务。(非 必须启动) ● OracleJobSchedulerORCL:数据库作业调度服务。(非必须启动) ● OracleDBConsoleorcl:Oracle控制台服务,即企业管理器服务。只有该服务启动了, 才可以使用Web方式的企业管理器管理数据库。(非必须启动) ● OracleVssWriterORCL:是Oracle对VSS提供支持的服务。(非必须启动) ● OracleMTSRecoveryService:是允许数据库充当一个微软事务服务器、COM/COM+ 对象和分布式环境下的事务资源管理器的服务。

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