当前位置:文档之家› 数据库系统概念(database system concepts)英文第六版 课后练习题 答案 第11章

数据库系统概念(database system concepts)英文第六版 课后练习题 答案 第11章

数据库系统概念(database system concepts)英文第六版 课后练习题 答案 第11章
数据库系统概念(database system concepts)英文第六版 课后练习题 答案 第11章

2Chapter11Indexing and Hashing

b.

c.

11.4Answer:

?With structure11.3.a:

Insert9:

10:

Insert

Exercises3

Delete23:

Delete

19:

?With structure11.3.b:

Insert

9:

Insert

4Chapter 11Indexing and Hashing

Delete

23:

Delete 19:

?

With structure 11.3.c:

Insert

9:

Insert

10:

Insert

8:

Delete 23:

Delete 19:

Exercises

5

11.5Answer:If there are K search-key values and m ?1siblings are involved

in the redistribution,the expected height of the tree is:log ?(m ?1)n /m ?(K )11.6Answer:Extendable hash structure

000 001

010 011 100101 110 111

11.7Answer:

a.Delete 11:From the answer to Exercise 11.6,change the third bucket

to:

At this stage,it is possible to coalesce the second and third buckets.

Then it is enough if the bucket address table has just four entries

instead of eight.For the purpose of this answer,we do not do the coalescing.

b.Delete 31:From the answer to 11.6,change the last bucket to:

6Chapter11Indexing and Hashing

c.Insert1:From the answer to11.6,change the?rst bucket to:

d.Insert15:From the answer to11.6,change the last bucket to:

11.8Answer:The pseudocode is shown in Figure11.1.

11.9Answer:Let i denote the number of bits of the hash value used in the

hash table.Let bsize denote the maximum capacity of each bucket.The

pseudocode is shown in Figure11.2.

Note that we can only merge two buckets at a time.The common hash

pre?x of the resultant bucket will have length one less than the two buckets

merged.Hence we look at the buddy bucket of bucket j differing from it

only at the last bit.If the common hash pre?x of this bucket is not i j,then

this implies that the buddy bucket has been further split and merge is not

possible.

When merge is successful,further merging may be possible,which is handled by a recursive call to coalesce at the end of the function.

11.10Answer:If the hash table is currently using i bits of the hash value,then

maintain a count of buckets for which the length of common hash pre?x

is exactly i.

Consider a bucket j with length of common hash pre?x i j.If the bucket

is being split,and i j is equal to i,then reset the count to1.If the bucket

is being split and i j is one less that i,then increase the count by1.It the

bucket if being coalesced,and i j is equal to i then decrease the count by

1.If the count becomes0,then the bucket address table can be reduced in

size at that point.

However,note that if the bucket address table is not reduced at that point,

then the count has no signi?cance afterwards.If we want to postpone the

reduction,we have to keep an array of counts,i.e.a count for each value of

Exercises7 function?ndIterator(value V){

/*Returns an iterator for the search on the value V*/

Iterator iter();

Set iter.v alue=V;

Set C=root node

while(C is not a leaf node)begin

Let i=samllest number such that V<=C.K i

if there is no such number i then begin

Let P m=last non-null pointer in the node

Set C=C.P m;

end

else Set C=C.P i;

end

/*C is a leaf node*/

Let i be the least value such that K i=V

if there is such a value i then begin

Set iter.index=i;

Set iter.page=C;

Set iter.acti v e=T RUE;

end

else if(V is the greater than the largest value in the leaf)then begin

if(C.P n.K1=V)then begin

Set iter.page=C.P n;

Set iter.index=1;

Set iter.acti v e=T RUE;

end

else Set iter.acti v e=F AL SE;

end

else Set iter.acti v e=F AL SE;

return(iter)

}

Class Iterator{

variables:

value V/*The value on which the index is searched*/

boolean active/*Stores the current state of the iterator(TRUE or FALSE)*/

int index/*Index of the next matching entry(if active is TRUE)*/

PageID page/*Page Number of the next matching entry(if active is TRUE)*/ function next(){

if(active)then begin

Set ret Page=page;

Set retI ndex=index;

if(index+1=page.size)then begin

page=page.P n

index=0

end

else index=index+1;

if(page.K index=V)

then acti v e=F AL SE;

return(ret Page,retI ndex)

end

else return null;

}

}

Figure11.1Pseudocode for?ndIterator and the Iterator class

8Chapter11Indexing and Hashing

delete(value K l)

begin

j=?rst i high-order bits of h(K l);

delete value K l from bucket j;

coalesce(bucket j);

end

coalesce(bucket j)

begin

i j=bits used in bucket j;

k=any bucket with?rst(i j?1)bits same as that

of bucket j while the bit i j is reversed;

i k=bits used in bucket k;

if(i j=i k)

return;/*buckets cannot be merged*/

if(entries in j+entries in k>bsize)

return;/*buckets cannot be merged*/

move entries of bucket k into bucket j;

decrease the value of i j by1;

make all the bucket-address-table entries,

which pointed to bucket k,point to j;

coalesce(bucket j);

end

Figure11.2Pseudocode for deletion

common hash pre?x.The array has to be updated in a similar fashion.The

bucket address table can be reduced if the i th entry of the array is0,where

i is the number of bits the table is using.Since bucket table reduction is

an expensive operation,it is not always advisable to reduce the table.It

should be reduced only when suf?cient number of entries at the end of

count array become0.

11.11Answer:We reproduce the instructor relation below.

Exercises9 ID dept salary

10101Comp.Sci.

Wu90000

15151Music

Einstein95000

32343History

Gold87000

45565Comp.Sci.

Cali?eri62000

76543Finance

Crick72000

83821Comp.Sci.

Kim80000

a.Bitmap for salary,with S1,S2,S3and S4representing the given inter-

vals in the same order

S1

000000000000

S3

010*********

b.The question is a bit trivial if there is no bitmap on the dept

name attribute is:

Comp.Sci

010********* Music

000101000000 History

000000000100 Elec.Eng.

010********* Finance

010*********

10Chapter11Indexing and Hashing

Scan on these records with salary80000or more gives Wu and Singh

as the instructors who satisfy the given query.

11.12Answer:If the index entries are inserted in ascending order,the new

entries get directed to the last leaf node.When this leaf node gets?lled,

it is split into two.Of the two nodes generated by the split,the left node

is left untouched and the insertions takes place on the right node.This

makes the occupancy of the leaf nodes to about50percent,except the last

leaf.

If keys that are inserted are sorted in descending order,the above situation

would still occur,but symmetrically,with the right node of a split never

getting touched again,and occupancy would again be50percent for all

nodes other than the?rst leaf.

11.13Answer:

a.The cost to locate the page number of the required leaf page for

an insertion is negligible since the non-leaf nodes are in memory.

On the leaf level it takes one random disk access to read and one

random disk access to update it along with the cost to write one

page.Insertions which lead to splitting of leaf nodes require an

additional page write.Hence to build a B+-tree with n r entries it

takes a maximum of2?n r random disk accesses and n r+2?(n r/f)

page writes.The second part of the cost comes from the fact that in

the worst case each leaf is half?lled,so the number of splits that

occur is twice n r/f.

The above formula ignores the cost of writing non-leaf nodes,since

we assume they are in memory,but in reality they would also be

written eventually.This cost is closely approximated by2?(n r/f)/f,

which is the number of internal nodes just above the leaf;we can

add further terms to account for higher levels of nodes,but these are

much smaller than the number of leaves and can be ignored.

b.Substituting the values in the above formula and neglecting the cost

for page writes,it takes about10,000,000?20milliseconds,or56

hours,since each insertion costs20milliseconds.

Exercises11

c.

function insert leaf(value K,pointer P)

if(tree is empty)create an empty leaf node L,which is also the root

else Find the last leaf node in the leaf nodes chain L

if(L has less than n?1key values)

then insert(K,P)at the?rst available location in L

else begin

Create leaf node L1

Set L.P n=L1;

Set K1=last value from page L

insert parent(1,L,K1,L1)

insert(K,P)at the?rst location in L1

end

function insert parent(level l,pointer P,value K,pointer P1)

if(level l is empty)then begin

Create an empty non-leaf node N,which is also the root

insert(P,K,P1)at the starting of the node N

return

else begin

Find the right most node N at level l

if(N has less than n pointers)

then insert(K,P1)at the?rst available location in N

else begin

Create a new non-leaf page N1

insert(P1)at the starting of the node N

insert parent(l+1,pointer N,value K,pointer N1)

end

end

The insert leaf function is called for each of the value,pointer

pairs in ascending order.Similar function can also be build for de-

scending order.The search for the last leaf or non-leaf node at any

level can be avoided by storing the current last page details in an

array.

The last node in each level might be less than half?lled.To make

this index structure meet the requirements of a B+-tree,we can re-

distribute the keys of the last two pages at each level.Since the last

but one node is always full,redistribution makes sure that both of

then are at least half?lled.

11.14Answer:In a B+-tree index or?le organization,leaf nodes that are

adjacent to each other in the tree may be located at different places on

disk.When a?le organization is newly created on a set of records,it is

possible to allocate blocks that are mostly contiguous on disk to leafs

nodes that are contiguous in the tree.As insertions and deletions occur

12Chapter11Indexing and Hashing

on the tree,sequentiality is increasingly lost,and sequential access has to

wait for disk seeks increasingly often.

a.One way to solve this problem is to rebuild the index to restore

sequentiality.

b.i.In the worst case each n-block unit and each node of the B+-tree

is half?lled.This gives the worst case occupancy as25percent.

ii.No.While splitting the n-block unit the?rst n/2leaf pages are

placed in one n-block unit,and the remaining in the second n-

block unit.That is,every n-block split maintains the order.Hence,

the nodes in the n-block units are consecutive.

iii.In the regular B+-tree construction,the leaf pages might not be

sequential and hence in the worst case,it takes one seek per leaf

https://www.doczj.com/doc/381092189.html,ing the block at a time method,for each n-node block,

we will have at least n/2leaf nodes in it.Each n-node block can

be read using one seek.Hence the worst case seeks comes down

by a factor of n/2.

iv.Allowing redistribution among the nodes of the same block,does

not require additional seeks,where as,in regular B+-tree we

require as many seeks as the number of leaf pages involved

in the redistribution.This makes redistribution for leaf blocks

ef?cient with this scheme.Also the worst case occupancy comes

back to nearly50percent.(Splitting of leaf nodes is preferred

when the participating leaf nodes are nearly full.Hence nearly

50percent instead of exact50percent)

毕业论文外文文献翻译-数据库管理系统的介绍

数据库管理系统的介绍 Raghu Ramakrishnan1 数据库(database,有时拼作data base)又称为电子数据库,是专门组织起来的一组数据或信息,其目的是为了便于计算机快速查询及检索。数据库的结构是专门设计的,在各种数据处理操作命令的支持下,可以简化数据的存储,检索,修改和删除。数据库可以存储在磁盘,磁带,光盘或其他辅助存储设备上。 数据库由一个或一套文件组成,其中的信息可以分解为记录,每一记录又包含一个或多个字段(或称为域)。字段是数据存取的基本单位。数据库用于描述实体,其中的一个字段通常表示与实体的某一属性相关的信息。通过关键字以及各种分类(排序)命令,用户可以对多条记录的字段进行查询,重新整理,分组或选择,以实体对某一类数据的检索,也可以生成报表。 所有数据库(最简单的除外)中都有复杂的数据关系及其链接。处理与创建,访问以及维护数据库记录有关的复杂任务的系统软件包叫做数据库管理系统(DBMS)。DBMS软件包中的程序在数据库与其用户间建立接口。(这些用户可以是应用程序员,管理员及其他需要信息的人员和各种操作系统程序)。 DBMS可组织,处理和表示从数据库中选出的数据元。该功能使决策者能搜索,探查和查询数据库的内容,从而对在正规报告中没有的,不再出现的且无法预料的问题做出回答。这些问题最初可能是模糊的并且(或者)是定义不恰当的,但是人们可以浏览数据库直到获得所需的信息。简言之,DBMS将“管理”存储的数据项,并从公共数据库中汇集所需的数据项以回答非程序员的询问。 DBMS由3个主要部分组成:(1)存储子系统,用来存储和检索文件中的数据;(2)建模和操作子系统,提供组织数据以及添加,删除,维护,更新数据的方法;(3)用户和DBMS之间的接口。在提高数据库管理系统的价值和有效性方面正在展现以下一些重要发展趋势; 1.管理人员需要最新的信息以做出有效的决策。 2.客户需要越来越复杂的信息服务以及更多的有关其订单,发票和账号的当前信息。 3.用户发现他们可以使用传统的程序设计语言,在很短的一段时间内用数据1Database Management Systems( 3th Edition ),Wiley ,2004, 5-12

数据库系统概论复习题及答案

第一学期期末考试试卷和答案 试卷代码:03115 授课课时:96 课程名称:数据库系统原理A 适用对象:本科选课班 一、选择题(从下列各题四个答案中选出一个正确答案,每小题1分,共10分) 1、在数据库技术发展的几个阶段中,数据独立性最高的是__A___阶段。 A、数据库系统 B、文件系统 C、人工管理 D、数据项管理 2、在SQL的SELECT语句中,与选择运算对应的命令动词是__C___。 A、SELECT B、FROM C、WHERE D、ORDER BY 3、在数据库中,下列说法_A__是不正确的 A、数据库避免了一切数据的重复 B、若系统是完全可以控制的,则系统可确保更新是的一致性 C、数据可以共享 D、数据库减少了冗余 4、在数据库系统中,模式/外模式映像用于解决数据的_C__ A、结构独立性 B、物理独立性 C、逻辑独立性 D、分布独立性 5、关系代数的5种基本运算是__D_。 A、并、差、选择、投影、自然连接 B、并、差、交、选择、投影 C、并、差、交、选择、笛卡尔积 D、并、差、选择、投影、笛卡尔积 6、在SQL语句中,谓词“EXISTS”的含义是_B___。 A、全称量词 B、存在量词 C、自然连接--在连接条件中使用等于(=)运算符比较被连接列的列值,但它使用选择列表指出查询结果集合中所包括的列,并删除连接表中的重复列 D、等值连接--在连接条件中使用等于号(=)运算符比较被连接列的列值,其查询结果中列出被连接表中的所有列,包括其中的重复列 7、规范化过程主要为克服数据库逻辑结构中的插入异常、删除异常、更新异常以及_C__的缺陷 A、数据不一致性 B、结构不合理 C、冗余度大 D、数据丢失 8、数据库数据的正确性和相容性是数据库的__B____。 A、安全性 B、可维护性 C、完整性 D、并发控制 9、数据库三级模式体系结构主要的目标是确保数据库的_B__。 A、数据安全性 B、数据独立性

数据库系统概念(各章节练习简答题答案)

数据库系统概念(章节练习简答题答案) 1 .试述sQL 语言的特点。 (l)综合统一。sQL 语言集数据定义语言DDL 、数据操纵语言DML、数据控制语言DCL 的功能于一体。(2)高度非过程化。用sQL 语言进行数据操作,只要提出“做什么”,而无需指明“怎么做”,因此无需了解存取路径,存取路径的选择以及sQL 语句的操作过程由系统自动完成。 (3)面向集合的操作方式。sQL 语言采用集合操作方式,不仅操作对象、查找结果可以是元组的集合,而且一次插入、删除、更新操作的对象也可以是元组的集合。 (4)以同一种语法结构提供两种使用方式。sQL 语言既是自含式语言,又是嵌入式语言。作为自含式语言,它能够独立地用于联机交互的使用方式;作为嵌入式语言,它能够嵌入到高级语言程序中,供程序员设计程序时使用。(5)语言简捷,易学易用。 2 .试述sQL 的定义功能。 sQL 的数据定义功能包括定义表、定义视图和定义索引。SQL 语言使用cREATE TABLE 语句建立基本表,ALTER TABLE 语句修改基本表定义,DROP TABLE 语句删除基本表;使用CREATE INDEX 语句建立索引,DROP INDEX 语句删除索引;使用CREA TE VIEW 语句建立视图,DROP VIEW 语句删除视图。 3 .什么是基本表?什么是视图?两者的区别和联系是什么? 基本表是本身独立存在的表,在sQL 中一个关系就对应一个表。视图是从一个或几个基本表导出的表。视图本身不独立存储在数据库中,是一个虚表。即数据库中只存放视图的定义而不存放视图对应的数据,这些数据仍存放在导出视图的基本表中。视图在概念上与基本表等同,用户可以如同基本表那样使用视图,可以在视图上再定义视图。 4.试述视图的优点。 ( l )视图能够简化用户的操作;( 2 )视图使用户能以多种角度看待同一数据;( 3 )视图对重构数据库提供了一定程度的逻辑独立性;( 4 )视图能够对机密数据提供安全保护。 5 .所有的视图是否都可以更新?为什么? 不是。视图是不实际存储数据的虚表,因此对视图的更新,最终要转换为对基本表的更新。因为有些视图的更新不能惟一有意义地转换成对相应基本表的更新,所以,并不是所有的视图都是可更新的. 6 .哪类视图可以更新的?哪类视图不可以更新的?各举一例说明。 基本表的行列子集视图一般是可更新的。若视图的属性来自集函数、表达式,则该视图肯定是不可以更新的。(举例在书上有) 7 .什么是数据库的安全性? 数据库的安全性是指保护数据库以防止不合法的使用所造成的数据泄露、更改或破坏。 8 .数据库安全性和计算机系统的安全性有什么关系? 安全性问题不是数据库系统所独有的,所有计算机系统都有这个问题。只是在数据库系统中大量数据集中存放,而且为许多最终用户直接共享,从而使安全性问题更为突出。 系统安全保护措施是否有效是数据库系统的主要指标之一。 数据库的安全性和计算机系统的安全性,包括操作系统、网络系统的安全性是紧密联系、相互支持的。 9 .什么是数据库中的自主存取控制方法和强制存取控制方法? 自主存取控制方法:定义各个用户对不同数据对象的存取权限。当用户对数据库访问时首先检查用户的存取权限。防止不合法用户对数据库的存取。 强制存取控制方法:每一个数据对象被(强制地)标以一定的密级,每一个用户也被(强制地)授予某一个级别的许可证。系统规定只有具有某一许可证级别的用户才能存取某一个密级的数据对象。 10. 为什么强制存取控制提供了更高级别的数据库安全性? 强制存取控制(MAC )是对数据本身进行密级标记,无论数据如何复制,标记与数据是一个不可分的整体,只有符合密级标记要求的用户才可以操纵数据,从而提供了更高级别的安全性。

9个常用的国外英文文献数据库

9个常用的国外英文论文文献数据库 9个论文文献数据库,科研搬砖,阅读涨姿势,论文写作小帮手!先说说什么是数据库:学术科研中说的「数据库」和「文献数据库」,往往是一种的形式,这个的贮存了大量文献数据(比如论文)可以简单的理解为一个网络图书馆。 数据库中的论文往往都是耗费了大量的时间和精力整理出来的,还有很多是需要购买才可以放在互联网上的,再加上维护这个本身就耗费颇多,因此这些数据库通常不是完全免费的,你可以在上面免费查找文献,浏览摘要等简介容,但是如果你要下载文献,就要付钱。 大学因为科研和教学需要,常年要下载大量的论文材料,所以就会和数据库的经营者签订很多协议,例如包年,就是给一定量的钱,然后就可以无限制下载论文。也有按照下载的数量进行计费。那英语作为世界第一学术语言,有哪些数据库是值得大家分享的呢?1、Wiley InterScience(英文文献期刊)Wiley InterScience是John Wiely & Sons公司创建的动态在线容服务,1997年开始在网上开通。通过InterScience,Wiley公司以许可协议形式向用户提供在线访问全文容的服务。Wiley InterScience收录了360多种科学、工程技术、医疗领域及相关专业期刊、30多种大型专业

参考书、13种实验室手册的全文和500多个题目的Wiley 学术图书的全文。网址:onlinelibrary.wiley./其中被SCI 收录的核心期刊近200种。期刊具体学科划分为:Business,Finance & Management (商业、金融和管理)、Chemistry (化学)、Computer Science(计算机科学)、Earth Science (地球科学)、Education (教育学)、Engineering (工程学)、Law(法律)、Life and Medical Sciences (生命科学与医学)、Mathematics and Statistics(数学统计学)、Physics (物理)、Psychology (心理学)。 2. ICPSRICPSR全称为Inter-university Consortium for Political and Social Research,即美国校际社会科学数据共享联盟。成立于1962年,位于美国密西根大学安娜堡分校(University of Michigan- Ann Arbor, 1817-),储存超过17000种调查研究资料,如军队官兵总名册,遗嘱、遗嘱查验与税收纪录,是现在世界上最大的社会科学数据中心,拥有600多个成员机构,包括大学和各种研究中心。网址:https://www.doczj.com/doc/381092189.html,/icpsrweb/landing.jsp其中400多个成员机构在美国,我国的国家人口发展研究战略课题组,大学,大学,科技大学,浸会大学也是成员之一。 3. IEEE 电气电子工程师学会IEEE(Institute of Electrical & Electronics Engineers)是电子信息领域最著名的跨国性学

数据库系统概论各章复习试题及答案

数据库系统概论复习资料: 第一章: 一、选择题: 1.在数据管理技术的发展过程中,经历了人工管理阶段、文件系统阶段和数据库系统阶段。在这几个阶段中,数据独立性最高的是 A 阶段。 A.数据库系统 B.文件系统 C.人工管理 D.数据项管理 2.数据库的概念模型独立于 A 。 A.具体的机器和DBMS B.E-R图 C.信息世界 D.现实世界 3.数据库的基本特点是 B 。 A.(1)数据可以共享(或数据结构化) (2)数据独立性 (3)数据冗余大,易移植 (4)统一管理和控制 B.(1)数据可以共享(或数据结构化) (2)数据独立性 (3)数据冗余小,易扩充 (4)统一管理和控制 C.(1)数据可以共享(或数据结构化) (2)数据互换性 (3)数据冗余小,易扩充 (4)统一管理和控制 D.(1)数据非结构化 (2)数据独立性 (3)数据冗余小,易扩充 (4)统一管理和控制 4. B 是存储在计算机内有结构的数据的集合。 A.数据库系统B.数据库 C.数据库管理系统 D.数据结构 5.数据库中存储的是 C 。 A.数据 B.数据模型C.数据以及数据之间的联系 D.信息 6. 数据库中,数据的物理独立性是指 C 。 A.数据库与数据库管理系统的相互独立 B.用户程序与DBMS的相互独立 C.用户的应用程序与存储在磁盘上数据库中的数据是相互独立的 D.应用程序与数据库中数据的逻辑结构相互独立 7. 数据库的特点之一是数据的共享,严格地讲,这里的数据共享是指 D 。 A.同一个应用中的多个程序共享一个数据集合 B.多个用户、同一种语言共享数据 C.多个用户共享一个数据文件 D.多种应用、多种语言、多个用户相互覆盖地使用数据集合 8.数据库系统的核心是 B 。 A.数据库 B.数据库管理系统 C.数据模型 D.软件工具 9. 下述关于数据库系统的正确叙述是 A 。 A.数据库系统减少了数据冗余 B.数据库系统避免了一切冗余 C.数据库系统中数据的一致性是指数据类型一致 D.数据库系统比文件系统能管理更多的数据 10. 数将数据库的结构划分成多个层次,是为了提高数据库的①和②。 ①A.数据独立性 B.逻辑独立性 C.管理规范性 D.数据的共享 ②A.数据独立性 B.物理独立性 C.逻辑独立性 D.管理规范性 【答案:】①B ②B 11. 数据库(DB)、数据库系统(DBS)和数据库管理系统(DBMS)三者之间的关系是 A 。 A.DBS包括DB和DBMS B.DDMS包括DB和DBS C.DB包括DBS和DBMS D.DBS就是DB,也就是DBMS

数据库外文参考文献及翻译.

数据库外文参考文献及翻译 数据库外文参考文献及翻译数据库管理系统——实施数据完整性一个数据库,只有用户对它特别有信心的时候。这就是为什么服务器必须实施数据完整性规则和商业政策的原因。执行SQL Server的数据完整性的数据库本身,保证了复杂的业务政策得以遵循,以及强制性数据元素之间的关系得到遵守。因为SQL Server的客户机/服务器体系结构允许你使用各种不同的前端应用程序去操纵和从服务器上呈现同样的数据,这把一切必要的完整性约束,安全权限,业务规则编码成每个应用,是非常繁琐的。如果企业的所有政策都在前端应用程序中被编码,那么各种应用程序都将随着每一次业务的政策的改变而改变。即使您试图把业务规则编码为每个客户端应用程序,其应用程序失常的危险性也将依然存在。大多数应用程序都是不能完全信任的,只有当服务器可以作为最后仲裁者,并且服务器不能为一个很差的书面或恶意程序去破坏其完整性而提供一个后门。SQL Server使用了先进的数据完整性功能,如存储过程,声明引用完整性(DRI),数据类型,限制,规则,默认和触发器来执行数据的完整性。所有这些功能在数据库里都有各自的用途;通过这些完整性功能的结合,可以实现您的数据库的灵活性和易于管理,而且还安全。声明数据完整性声明数据完整原文请找腾讯3249114六,维-论'文.网 https://www.doczj.com/doc/381092189.html, 定义一个表时指定构成的主键的列。这就是所谓的主键约束。SQL Server使用主键约束以保证所有值的唯一性在指定的列从未侵犯。通过确保这个表有一个主键来实现这个表的实体完整性。有时,在一个表中一个以上的列(或列的组合)可以唯一标志一行,例如,雇员表可能有员工编号( emp_id )列和社会安全号码( soc_sec_num )列,两者的值都被认为是唯一的。这种列经常被称为替代键或候选键。这些项也必须是唯一的。虽然一个表只能有一个主键,但是它可以有多个候选键。 SQL Server的支持多个候选键概念进入唯一性约束。当一列或列的组合被声明是唯一的, SQL Server 会阻止任何行因为违反这个唯一性而进行的添加或更新操作。在没有故指的或者合适的键存在时,指定一个任意的唯一的数字作为主键,往往是最有效的。例如,企业普遍使用的客户号码或账户号码作为唯一识别码或主键。通过允许一个表中的一个列拥有身份属性,SQL Server可以更容易有效地产生唯一数字。您使用的身份属性可以确保每个列中的值是唯一的,并且值将从你指定的起点开始,以你指定的数量进行递增(或递减)。(拥有特定属性的列通常也有一个主键或唯一约束,但这不是必需的。)第二种类型的数据完整性是参照完整性。 SQL Server实现了表和外键约束之间的逻辑关系。外键是一个表中的列或列的组合,连接着另一个表的主键(或着也可能是替代键)。这两个表之间的逻辑关系是关系模型的基础;参照完整性意味着这种关系是从来没有被违反的。例如,一个包括出版商表和标题表的简单的select例子。在标题表中,列title_id (标题编号)是主键。在出版商表,列pub_id (出版者ID )是主键。 titles表还包括一个pub_id列,这不是主键,因为出版商可以发布多个标题。相反, pub_id是一个外键,它对应着出版商表的主键。如果你在定义表的时候声明了这个关系, SQL Server由双方执行它。首先,它确保标题不能进入titles表,或在titles表中现有的pub_id无法被修改,除非有效的出版商ID作为新pub_id出现在出版商表中。其次,它确保在不考虑titles表中对应值的情况下,出版商表中的pub_id的值不做任何改变。以下两种方法可

(完整版)数据库系统概论试题及答案3

试题三 一、单项选择题 (本大题共20小题,每小题1.5分,共30分) 在每小题列出的四个备选项中只有一个是符合题目要 求的,请将其代码填写在题后的括号内。错选、多选或 未选均无分。 1. 数据库系统与文件系统的主要区别是() A.数据库系统复杂,而文件系统简单 B.文件系统不能解决数据冗余和数据独立性问题,而数据库系统可以解决C.文件系统只能管理程序文件,而数据库系统能够管理各种类型的文件D.文件系统管理的数据量较少,而数据库系统可以管理庞大的数据量 2.数据库管理系统能实现对数据库中数据的查询、插入、修改和删除等操作的 数据库语言称为() A.数据定义语言(DDL)B.数据管理语言 C.数据操纵语言(DML)D.数据控制语言 3.数据库的网状模型应满足的条件是() A.允许一个以上结点无双亲,也允许一个结点有多个双亲 B.必须有两个以上的结点 C.有且仅有一个结点无双亲,其余结点都只有一个双亲 D.每个结点有且仅有一个双亲 4.数据的逻辑独立性是指() A.内模式改变,模式不变 B.模式改变,内模式不变 C.模式改变,外模式和应用程序不变 D.内模式改变,外模式和应用程序不变 5.设有关系模式EMP(职工号,姓名,年龄,技能)。假设职工号唯一,每个职工有多项技能,则EMP表的主码是() A.职工号B.姓名,技能 C.技能D.职工号,技能 6.在关系代数中,对一个关系做投影操作后,新关系的元组个数()原来 关系的元组个数。

A.小于B.小于或等于C.等于D.大于 7.设关系R和S的属性个数分别是2和3,那么R S等价于() 1<2 A.σ1<2(R?S)B.σ1<4(R?S) C.σ1<2(R S)D.σ1<4(R S) 8.学校数据库中有学生和宿舍两个关系: 学生(学号,姓名)和宿舍(楼名,房间号,床位号,学号) 假设有的学生不住宿,床位也可能空闲。如果要列出所有学生住宿和宿舍分配的情况,包括没有住宿的学生和空闲的床位,则应执行() A. 全外联接 B. 左外联接 C. 右外联接 D. 自然联接 9.用下面的T-SQL语句建立一个基本表: CREATE TABLE Student(Sno CHAR (4) NOT NULL, Sname CHAR (8) NOT NULL, Sex CHAR (2), Age SMALLINT) 可以插入到表中的元组是() A. '5021','刘祥',男,21 B.NULL,'刘祥',NULL,21 C. '5021',NULL,男,21 D. '5021','刘祥',NULL,NULL 10. 把对关系SC的属性GRADE的修改权授予用户ZHAO的T-SQL语句是 () A. GRANT GRADE ON SC TO ZHAO B. GRANT UPDA TE ON SC TO ZHAO C. GRANT UPDA TE (GRADE) ON SC TO ZHAO D. GRANT UPDA TE ON SC (GRADE) TO ZHAO 11.图1中()是关系完备的系统 A B C D 图1 12.给定关系模式SCP(Sno,Cno,P),其中Sno表示学号,Cno表示课程号,P 表示名次。若每一名学生每门课程有一定的名次,每门课程每一名次只有一名学生,则以下叙述中错误的是()

大学毕业设计仓库管理系统数据库计算机外文参考文献原文及翻译

河北工程大学毕业论文(设计)英文参考文献原文复印件及译文 数据仓库 数据仓库为商务运作提供结构与工具,以便系统地组织、理解和使用数据进行决策。大量组织机构已经发现,在当今这个充满竞争、快速发展的世界,数据仓库是一个有价值的工具。在过去的几年中,许多公司已花费数百万美元,建立企业范围的数据仓库。许多人感到,随着工业竞争的加剧,数据仓库成了必备的最新营销武器——通过更多地了解客户需求而保住客户的途 径。“那么”,你可能会充满神秘地问,“到底什么是数据仓库?” 数据仓库已被多种方式定义,使得很难严格地定义它。宽松地讲,数据仓库是一个数据库,它与组织机构的操作数据库分别维护。数据仓库系统允许将各种应用系统集成在一起,为统一的历史数据分析提供坚实的平台,对信息处理提供支持。 按照W. H. Inmon,一位数据仓库系统构造方面的领头建筑师的说法,“数 (1) 视图。 (2)

般文件和联机事务处理记录,集成在一起。使用数据清理和数据集成技术,确保命名约定、编码结构、属性度量的一致性等。 (3)时变的:数据存储从历史的角度(例如,过去5-10 年)提供信息。数据仓库中的关键结构,隐式或显式地包含时间元素。 (4) 非易失的:数据仓库总是物理地分离存放数据;这些数据源于操作环境下的应用数据。由于这种分离,数据仓库不需要事务处理、恢复和并行控制机制。通常,它只需要两种数据访问:数据的初始化装入和数据访问。 概言之,数据仓库是一种语义上一致的数据存储,它充当决策支持数据模型的物理实现,并存放企业决策所需信息。数据仓库也常常被看作一种体系结构,通过将异种数据源中的数据集成在一起而构造,支持结构化和启发式查询、分析报告和决策制定。 “好”,你现在问,“那么,什么是建立数据仓库?” 根据上面的讨论,我们把建立数据仓库看作构造和使用数据仓库的过程。数据仓库的构造需要数据集成、数据清理、和数据统一。利用数据仓库常常需要一些决策支持技术。这使得“知识工人”(例如,经理、分析人员和主管)能够使用数据仓库,快捷、方便地得到数据的总体视图,根据数据仓库中的信息做出准确的决策。有些作者使用术语“建立数据仓库”表示构造数据仓库的过程,而用术语“仓库DBMS”表示管理和使用数据仓库。我们将不区分二者。 “组织机构如何使用数据仓库中的信息?”许多组织机构正在使用这些信息支持商务决策活动,包括: (1)、增加顾客关注,包括分析顾客购买模式(如,喜爱买什么、购买时间、预算周期、消费习惯); (2)、根据季度、年、地区的营销情况比较,重新配置产品和管理投资,调整生产策略; (3)、分析运作和查找利润源; (4)、管理顾客关系、进行环境调整、管理合股人的资产开销。 从异种数据库集成的角度看,数据仓库也是十分有用的。许多组织收集了形形色色数据,并由多个异种的、自治的、分布的数据源维护大型数据库。集成这些数据,并提供简便、有效的访问是非常希望的,并且也是一种挑战。数据库工业界和研究界都正朝着实现这一目标竭尽全力。 对于异种数据库的集成,传统的数据库做法是:在多个异种数据库上,建立一个包装程序和一个集成程序(或仲裁程序)。这方面的例子包括IBM 的数据连接程序和Informix的数据刀。当一个查询提交客户站点,首先使用元数据字典对查询进行转换,将它转换成相应异种站点上的查询。然后,将这些查询

数据库系统概论课后练习答案4

第4章数据库安全性 1 .什么是数据库的安全性? 答:数据库的安全性是指保护数据库以防止不合法的使用所造成的数据泄露、更改或破坏。 2 .数据库安全性和计算机系统的安全性有什么关系? 答:安全性问题不是数据库系统所独有的,所有计算机系统都有这个问题。只是在数据库系统中大量数据集中存放,而且为许多最终用户直接共享,从而使安全性问题更为突出。 系统安全保护措施是否有效是数据库系统的主要指标之一。 数据库的安全性和计算机系统的安全性,包括操作系统、网络系统的安全性是紧密联系、相互支持的。 3 .试述可信计算机系统评测标准的情况,试述TDI / TCSEC 标准的基本内容。 答:各个国家在计算机安全技术方面都建立了一套可信标准。目前各国引用或制定的一系列安全标准中,最重要的是美国国防部(DoD )正式颁布的《 DoD 可信计算机系统评估准则》。CC通用准则V2.1版于1999年被ISO纳为国际标准,2001年我国采用其为国家标准。目前CC已经基本取代了TCSEC,成为评估信息产品安全性的主要标准。 TDI / TCSEC 标准是将TcsEc 扩展到数据库管理系统,即《可信计算机系统评估标准关于可信数据库系统的解释》(Tmsted Database Interpretation 简称TDI , 又称紫皮书)。在TDI 中定义了数据库管理系统的设计与实现中需满足和用以进行安全性级别评估的标准。 TDI 与TcsEc 一样,从安全策略、责任、保证和文档四个方面来描述安全性级别划分的指标。每个方面又细分为若干项。 CC提出目前国际公认的表述信息技术安全性的结构,即把对信息产品的安全要求分为安全功能要求和安全保证要求。 安全功能要求用以规范产品和系统的安全行为,安全保证要求解决如何正确、有效地实施这些功能。 4 .试述TcsEC ( TDI )将系统安全级别划分为4 组7 个等级的基本内容。 答:根据计算机系统对安全性各项指标的支持情况,TCSEC ( TDI )将系统划分为四组(division )7 个等级,依次是 D 、C ( CI , CZ )、B ( BI , BZ , B3 )、A ( AI ) ,按系统可靠或可信程度逐渐增高。 这些安全级别之间具有一种偏序向下兼容的关系,即较高安全性级别提供的安全保护包含较低级别的所有保护要求,同时提供更多或更完善的保护能力。各个等级的基本内容为: ● D 级D 级是最低级别。一切不符合更高标准的系统,统统归于D 组。 ●Cl级只提供了非常初级的自主安全保护。能够实现对用户和数据的分离,进行自主存取控制 (DAC ) ,保护或限制用户权限的传播。 ●C2 级实际是安全产品的最低档次,提供受控的存取保护,即将Cl 级的DAC 进一步细化,以个 人身份注册负责,并实施审计和资源隔离。 ●Bl 级标记安全保护。对系统的数据加以标记,并对标记的主体和客体实施强制存取控制(MAC ) 以及审计等安全机制。

外文文献之数据库信息管理系统简介

Introduction to database information management system The database is stored together a collection of the relevant data, the data is structured, non-harmful or unnecessary redundancy, and for a variety of application services, data storage independent of the use of its procedures; insert new data on the database , revised, and the original data can be retrieved by a common and can be controlled manner. When a system in the structure of a number of entirely separate from the database, the system includes a "database collection." Database management system (database management system) is a manipulation and large-scale database management software is being used to set up, use and maintenance of the database, or dbms. Its unified database management and control so as to ensure database security and integrity. Dbms users access data in the database, the database administrator through dbms database maintenance work. It provides a variety of functions, allows multiple applications and users use different methods at the same time or different time to build, modify, and asked whether the database. It allows users to easily manipulate data definition and maintenance of data security and integrity, as well as the multi-user concurrency control and the restoration of the database. Using the database can bring many benefits: such as reducing data redundancy, thus saving the data storage space; to achieve full sharing of data resources, and so on. In addition, the database technology also provides users with a very simple means to enable users to easily use the preparation of the database applications. Especially in recent years introduced micro-computer relational database management system dBASELL, intuitive operation, the use of flexible, convenient programming environment to extensive (generally 16 machine, such as IBM / PC / XT, China Great Wall 0520, and other species can run software), data-processing capacity strong. Database in our country are being more and more widely used, will be a powerful tool of economic management. The database is through the database management system (DBMS-DATA BASE MANAGEMENT SYSTEM) software for data storage, management and use of dBASELL is a database management system software. Information management system is the use of data acquisition and transmission technology, computer network technology, database construction, multimedia

数据库系统概念第六版课后习题部分答案2s

C H A P T E R2 Introduction to the Relational Model Practice Exercises 2.1Consider the relational database of Figure??.What are the appropriate primary keys? Answer:The answer is shown in Figure2.1,with primary keys under- lined. 2.2Consider the foreign key constraint from the dept name attribute of in- structor to the department relation.Give examples of inserts and deletes to these relations,which can cause a violation of the foreign key constraint. Answer: ?Inserting a tuple: (10111,Ostrom,Economics,110,000) into the instructor table,where the department table does not have the department Economics,would violate the foreign key constraint. ?Deleting the tuple: (Biology,Watson,90000) from the department table,where at least one student or instructor tuple has dept name as Biology,would violate the foreign key con- straint. employee(person name,street,city) works(person name company name,salary) company(company name,city) Figure2.1Relational database for Practice Exercise2.1. 1

《数据库系统概论》课后习题及参考答案

课后作业习题 《数据库系统概论》课程部分习题及参考答案 第一章绪论(教材 41页) 1.试述数据、数据库、数据库系统、数据库管理系统的概念。 数据: 描述事物的符号记录称为数据。数据的种类有文字、图形、图象、声音、正文等等。数据与其语义是不可分的。 数据库: 数据库是长期储存在计算机内、有组织的、可共享的数据集合。数据库中的数据按一定的数据模型组织、描述和储存,具有较小的冗余度、较高的数据独立性和易扩展性,并可为各种用户共享。 数据库系统: 数据库系统( DBS)是指在计算机系统中引入数据库后的系统构成。数据库系统由数据库、数据库管理系统(及其开发工具)、应用系统、数据库管理员构成。 数据库管理系统: 数据库管理系统 (DBMS)是位于用户与操作系统之间的一层数据管理软件。用于科学地组织和存储数据、高效地获取和维护数据。DBMS主要功能包括数据定义功能、数据操纵功能、数据库的运行管理功能、数据库的建立和维护功能。 2.使用数据库系统有什么好处? 使用数据库系统的好处是由数据库管理系统的特点或优点决定的。 使用数据库系统的好处很多,例如可以大大提高应用开发的效率,方便用户的使用,减轻数据库系统管理人员维护的负担等。 为什么有这些好处,可以结合第 5题来回答。

使用数据库系统可以大大提高应用开发的效率。因为在数据库系统中应用程序不必考虑数据的定义、存储和数据存取的具体路径,这些工作都由 DBMS来完成。 此外,当应用逻辑改变,数据的逻辑结构需要改变时,由于数据库系统提供了数据与程序之间的独立性。数据逻辑结构的改变是 DBA的责任,开发人员不必修改应用程序,或者只需要修改很少的应用程序。从而既简化了应用程序的编制,又大大减少了应用程序的维护和修改。 使用数据库系统可以减轻数据库系统管理人员维护系统的负担。因为 DBMS在数据库建立、运用和维护时对数据库进行统一的管理和控制,包括数据的完整性、安全性,多用户并发控制,故障恢复等等都由DBMS执行。 总之,使用数据库系统的优点是很多的,既便于数据的集中管理,控制数据冗余,可以提高数据的利用率和一致性,又有利于应用程序的开发和维护。 3.试述文件系统与数据库系统的区别和联系。 文件系统与数据库系统的区别: 文件系统面向某一应用程序,共享性差、冗余度大,独立性差,纪录内有结构、整体无结构,应用程序自己控制。 数据库系统面向现实世界,共享性高、冗余度小,具有高度的物理独立性和一定的逻辑独立性,整体结构化,用数据模型描述,由数据库管理系统提供数据安全性、完整性、并发控制和恢复能力。 文件系统与数据库系统的联系是: 文件系统与数据库系统都是计算机系统中管理数据的软件。 5.试述数据库系统的特点。 数据库系统的主要特点有: 一、数据结构化 数据库系统实现整体数据的结构化,这是数据库的主要特征之一,也是数据库系统与文件系统的本质区别。 二、数据的共享性高,冗余度低,易扩充

信息系统和数据库中英文对照外文翻译文献

中英文对照翻译 信息系统开发和数据库开发 在许多组织中,数据库开发是从企业数据建模开始的,企业数据建模确定了组织数据库的范围和一般内容。这一步骤通常发生在一个组织进行信息系统规划的过程中,它的目的是为组织数据创建一个整体的描述或解释,而不是设计一个特定的数据库。一个特定的数据库为一个或多个信息系统提供数据,而企业数据模型(可能包含许多数据库)描述了由组织维护的数据的范围。在企业数据建模时,你审查当前的系统,分析需要支持的业务领域的本质,描述需要进一步抽象的数据,并且规划一个或多个数据库开发项目。图1显示松谷家具公司的企业数据模型的一个部分。 1.1 信息系统体系结构 如图1所示,高级的数据模型仅仅是总体信息系统体系结构(ISA)一个部分或一个组织信息系统的蓝图。在信息系统规划期间,你可以建立一个企业数据模型作为整个信息系统体系结构的一部分。根据Zachman(1987)、Sowa和Zachman (1992)的观点,一个信息系统体系结构由以下6个关键部分组成: 数据(如图1所示,但是也有其他的表示方法)。 操纵数据的处理(着系可以用数据流图、带方法的对象模型或者其他符号表示)。 网络,它在组织内并在组织与它的主要业务伙伴之间传输数据(它可以通过网络连接和拓扑图来显示)。 人,人执行处理并且是数据和信息的来源和接收者(人在过程模型中显示为数据的发送者和接收者)。 执行过程的事件和时间点(它们可以用状态转换图和其他的方式来显示)。 事件的原因和数据处理的规则(经常以文本形式显示,但是也存在一些用于规划的图表工具,如决策表)。 1.2 信息工程 信息系统的规划者按照信息系统规划的特定方法开发出信息系统的体系结构。信息工程是一种正式的和流行的方法。信息工程是一种面向数据的创建和维护信息系统的方法。因为信息工程是面向数据的,所以当你开始理解数据库是怎样被标识和定义时,信息工程的一种简洁的解释是非常有帮助的。信息工程遵循自顶向下规划的方法,其中,特定的信息系统从对信息需求的广泛理解中推导出来(例如,我们需要关于顾客、产品、供应商、销售员和加工中心的数据),而不是合并许多详尽的信息请求(如一个订单输入屏幕或按照地域报告的销售汇总)。自顶向下规划可使开发人员更全面地规划信息系统,提供一种考虑系统组件集成的方法,增进对信息系统与业务目标的关系的理解,加深对信息系统在整个组织中的影响的理解。 信息工程包括四个步骤:规划、分析、设计和实现。信息工程的规划阶段产

数据库系统概论试题及答案整理版

数据库系统概论复习资料 第一章绪论 一、选择题 1.在数据管理技术的发展过程中,经历了人工管理阶段、文件系统阶段和数据库系统阶段。在这几个 阶段中,数据独立性最高的是 A 阶段。 A.数据库系B.文件系统C.人工管理D.数据项管理 2.数据库的概念模型独立于 A 。 A.具体的机器和DBMS B.E-R图C.信息世界D.现实世界 3.数据库的基本特点是 B 。 A.(1)数据结构化(2)数据独立性 (3)数据共享性高,冗余大,易移植 (4)统一管理和控制 B.(1)数据结构化(2)数据独立性 (3)数据共享性高,冗余小,易扩充 (4)统一管理和控制 C.(1)数据结构化(2)数据互换性 (3)数据共享性高,冗余小,易扩充 (4)统一管理和控制 D.(1)数据非结构化 (2)数据独立性 (3)数据共享性高,冗余小,易扩充 (4)统一管理和控制 4. B 是存储在计算机内有结构的数据的集合。 A.数据库系统B.数据库C.数据库管理系统D.数据结构 5.数据库中存储的是 C 。 A. 数据 B. 数据模型 C.数据及数据间的联系 D. 信息 6.数据库中,数据的物理独立性是指 C 。 A.数据库与数据库管理系统的相互独立 B.用户程序与DBMS的相互独立 C.用户的应用程序与存储在磁盘上数据库中的数据是相互独立的 D.应用程序与数据库中数据的逻辑结构相互独立 7.数据库的特点之一是数据的共享,严格地讲,这里的数据共享是指 D 。 A.同一个应用中的多个程序共享一个数据集合 B.多个用户、同一种语言共享数据 C.多个用户共享一个数据文件 D.多种应用、多种语言、多个用户相互覆盖地使用数据集合

计算机专业DatabaseManagementSystems数据库管理系统介绍毕业论文外文文献翻译及原文

毕业设计(论文) 外文文献翻译 文献、资料中文题目:数据库管理系统介绍 文献、资料英文题目:Database Management Systems 文献、资料来源: 文献、资料发表(出版)日期: 院(部): 专业: 班级: 姓名: 学号: 指导教师: 翻译日期: 2017.02.14

外文资料 Database Management Systems A database (sometimes spelled data base) is also called an electronic database , referring to any collection of data, or information, that is specially organized for rapid search and retrieval by a computer. Databases are structured to facilitate the storage, retrieval , modification, and deletion of data in conjunction with various data-processing operations .Databases can be stored on magnetic disk or tape, optical disk, or some other secondary storage device. A database consists of a file or a set of files. The information in these files may be broken down into records, each of which consists of one or more fields. Fields are the basic units of data storage , and each field typically contains information pertaining to one aspect or attribute of the entity described by the database . Using keywords and various sorting commands, users can rapidly search , rearrange, group, and select the fields in many records to retrieve or create reports on particular aggregate of data. Complex data relationships and linkages may be found in all but the simplest databases .The system software package that handles the difficult tasks associated with creating ,accessing, and maintaining database records is called a database management system(DBMS).The programs in a DBMS package establish an interface between the database itself and the users of the database.. (These users may be applications programmers, managers and others with information needs, and various OS programs.) A DBMS can organize, process, and present selected data elements form the database. This capability enables decision makers to search, probe, and query database contents in order to extract answers to nonrecurring and unplanned questions that aren’t available in regular reports. These questions might initially be vague and/or poorly defined ,but people can “browse” through the database until they have the needed information. In short, the DBMS will “manage” the stored data items and assemble the needed items from the common database in response to the queries of those who aren’t programmers. A database management system (DBMS) is composed of three major parts:(1)a storage subsystem that stores and retrieves data in files;(2) a modeling and manipulation subsystem that provides the means with which to organize the data and to add , delete, maintain, and update the data;(3)and an interface between the DBMS and its users. Several major trends are emerging that enhance the value and usefulness of database management systems;

相关主题
文本预览
相关文档 最新文档