当前位置:文档之家› 数据库系统基础教程第二章答案解析

数据库系统基础教程第二章答案解析

数据库系统基础教程第二章答案解析
数据库系统基础教程第二章答案解析

Exercise 2.2.1a

For relation Accounts, the attributes are:

acctNo, type, balance

For relation Customers, the attributes are:

firstName, lastName, idNo, account

Exercise 2.2.1b

For relation Accounts, the tuples are:

(12345, savings, 12000),

(23456, checking, 1000),

(34567, savings, 25)

For relation Customers, the tuples are:

(Robbie, Banks, 901-222, 12345),

(Lena, Hand, 805-333, 12345),

(Lena, Hand, 805-333, 23456)

Exercise 2.2.1c

For relation Accounts and the first tuple, the components are: 123456 → acctNo

savings → type

12000 → balance

For relation Customers and the first tuple, the components are: Robbie → firstName

Banks → lastName

901-222 → idNo

12345 → account

Exercise 2.2.1d

For relation Accounts, a relation schema is:

Accounts(acctNo, type, balance)

For relation Customers, a relation schema is:

Customers(firstName, lastName, idNo, account) Exercise 2.2.1e

An example database schema is:

Accounts (

acctNo,

type,

balance

)

Customers (

firstName,

lastName,

idNo,

account

)

Exercise 2.2.1f

A suitable domain for each attribute:

acctNo → Integer

type → String

balance → Integer

firstName → String

lastName → String

idNo → String (because there is a hyphen we cannot use Integer)

account → Integer

Exercise 2.2.1g

Another equivalent way to present the Account relation:

Another equivalent way to present the Customers relation:

Exercise 2.2.2

Examples of attributes that are created for primarily serving as keys in a relation:

Universal Product Code (UPC) used widely in United States and Canada to track products in stores.

Serial Numbers on a wide variety of products to allow the manufacturer to individually track each product.

Vehicle Identification Numbers (VIN), a unique serial number used by the automotive industry to identify vehicles.

Exercise 2.2.3a

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.

Exercise 2.2.3b

We can order the three tuples in any of 5! = 120 ways. Also, the columns can be ordered in any of 4! = 24 ways. Thus, the number of presentations is 120*24 = 2880

Exercise 2.2.3c

We can order the three tuples in any of m! ways. Also, the columns can be ordered in any of n! ways. Thus, the number of presentations is n!m!

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)

);

Exercise 2.3.1c

CREATE TABLE Laptop (

model CHAR(30),

speed DECIMAL(4,2),

ram INTEGER,

hd INTEGER,

screen DECIMAL(3,1),

price DECIMAL(7,2)

);

Exercise 2.3.1d

CREATE TABLE Printer (

model CHAR(30),

color BOOLEAN,

type CHAR (10),

price DECIMAL(7,2)

);

Exercise 2.3.1e

ALTER TABLE Printer DROP color;

Exercise 2.3.1f

ALTER TABLE Laptop ADD od CHAR (10) DEFAULT ‘none’;

Exercise 2.3.2a

CREATE TABLE Classes (

class CHAR(20),

type CHAR(5),

country CHAR(20),

numGuns INTEGER,

bore DECIMAL(3,1),

displacement INTEGER

);

Exercise 2.3.2b

CREATE TABLE Ships (

name CHAR(30),

class CHAR(20),

launched INTEGER

);

Exercise 2.3.2c

CREATE TABLE Battles (

name CHAR(30),

date DATE

);

Exercise 2.3.2d

CREATE TABLE Outcomes (

ship CHAR(30),

battle CHAR(30),

result CHAR(10)

);

Exercise 2.3.2e

ALTER TABLE Classes DROP bore;

Exercise 2.3.2f

ALTER TABLE Ships ADD yard CHAR(30);

Exercise 2.4.1a

R1 := σspeed ≥ 3.00 (PC)

R2 := πmodel (R1)

Exercise 2.4.1b

R1 := σhd ≥ 100 (Laptop)

R2 := Product (R1)

R3 := πmaker (R2)

Exercise 2.4.1c

R1 := σmaker=B (Product PC)

R2 := σmaker=B (Product Laptop)

R3 := σ

maker=B (Product Printer)

R4 := πmodel,price (R1)

R5 := πmodel,price (R2)

R6: = πmodel,price (R3)

R7 := R4 R5 R6

Exercise 2.4.1d

R1 := σcolor = true AND type = laser (Printer)

R2 := πmodel (R1)

Exercise 2.4.1e

R1 := σtype=laptop (Product)

R2 := σtype=PC(Product)

R3 := πmaker(R1)

R4 := πmaker(R2)

R5 := R3 – R4

Exercise 2.4.1f

R1 := ρPC1(PC)

R2 := ρPC2(PC)

R3 := R1 (PC1.hd = PC2.hd AND PC1.model <> PC2.model) R2

R4 := πhd(R3)

Exercise 2.4.1g

R1 := ρPC1(PC)

R2 := ρPC2(PC)

R3 := R1 (PC1.speed = PC2.speed AND PC1.ram = PC2.ram AND PC1.model < PC2.model) R2

R4 := πPC1.model,PC2.model(R3)

Exercise 2.4.1h

R1 := πmodel(σspeed ≥ 2.80(PC)) πmodel(σspeed ≥ 2.80(Laptop))

R2 := πmaker,model(R1 Product)

R3 := ρR3(maker2,model2)(R2)

R4 := R2 (maker = maker2 AND model <> model2) R3

R5 := πmaker(R4)

Exercise 2.4.1i

R1 := πmodel,speed (PC)

R2 := πmodel,speed (Laptop)

R3 := R1 R2 R4 := ρR4(model2,speed2)(R3)

R5 := πmodel,speed (R3

(speed < speed2 ) R4)

R6 := R3 – R5

(R6 Product)

Exercise 2.4.1j

R1 := πmaker,speed (Product

PC)

R2 := ρR2(maker2,speed2)(R1)

R3 := ρR3(maker3,speed3)(R1)

R4 := R1 (maker = maker2 AND speed <> speed2) R2

R5 := R4 (maker3 = maker AND speed3 <> speed2 AND speed3 <> speed) R3

R6 := πmaker (R5)

Exercise 2.4.1k

R1 := πmaker,model (Product PC)

R2 := ρR2(maker2,model2)(R1)

R3 := ρR3(maker3,model3)(R1)

R4 := ρR4(maker4,model4)(R1)

R5 := R1 (maker = maker2 AND model <> model2) R2

R6 := R3 (maker3 = maker AND model3 <> model2 AND model3 <> model) R5

R7 := R4 (maker4 = maker AND (model4=model OR model4=model2 OR model4=model3)) R6

R8 := πmaker (R7)

Exercise 2.4.2a

πmodel

σspeed≥3.00PC

Exercise 2.4.2b

Laptop

σhd ≥ 100 Product

π

maker

Exercise 2.4.2c

σmaker=B

πmodel,price σmaker=B πmodel,price

σmaker=B πmodel,price

Product PC Laptop Printer Product

Product

Exercise 2.4.2d

Printer

σcolor = true AND type = laser

πmodel

Exercise 2.4.2e

σtype=laptop

σtype=PC πmaker

πmaker –

Product

Product

Exercise 2.4.2f

ρPC1

ρPC2 (PC1.hd = PC2.hd AND PC1.model <> PC2.model)

πhd

PC PC

Exercise 2.4.2g

ρPC1ρPC2PC PC

(PC1.speed = PC2.speed AND PC1.ram = PC2.ram AND PC1.model < PC2.model)

πPC1.model,PC2.model

Exercise 2.4.2h

PC

Laptop σ

speed ≥ 2.80σspeed ≥ 2.80πmodel πmodel πmaker,model

ρR3(maker2,model2)

(maker = maker2 AND model <> model2)

πmaker

Exercise 2.4.2i

PC

Laptop

Product

πmodel,speed πmodel,speed ρR4(model2,speed2)

πmodel,speed

(speed < speed2 )

πmaker

Exercise 2.4.2j

Product PC πmaker,speed ρR3(maker3,speed3)

ρR2(maker2,speed2)

(maker = maker2 AND speed <> speed2)

(maker3 = maker AND speed3 <> speed2 AND speed3 <> speed)

πmaker

Exercise 2.4.2k

πmaker

(maker4 = maker AND (model4=model OR model4=model2 OR model4=model3)) (maker3 = maker AND model3 <> model2 AND model3 <> model)

(maker = maker2 AND model <> model2)

ρR2(maker2,model2)ρR3(maker3,model3)ρR4(maker4,model4)

πmaker,model

Product PC

Exercise 2.4.3a

R1 := σbore ≥ 16 (Classes)

R2 := πclass,country (R1)

Exercise 2.4.3b

R1 := σlaunched < 1921 (Ships)

R2 := πname (R1)

Exercise 2.4.3c

R1 := σbattle=Denmark Strait AND result=sunk(Outcomes)

R2 := πship (R1)

Exercise 2.4.3d

R1 := Classes Ships

R2 := σlaunched > 1921 AND displacement > 35000 (R1)

R3 := πname (R2)

Exercise 2.4.3e

R1 := σbattle=Guadalcanal(Outcomes)

R2 := Ships (ship=name) R1

R3 := Classes R2

R4 := πname,displacement,numGuns(R3)

Exercise 2.4.3f

R1 := πname(Ships)

R2 := πship(Outcomes)

R3 := ρR3(name)(R2)

R4 := R1 R3

Exercise 2.4.3g

From 2.3.2, assuming that every class has one ship named after the class.

R1 := πclass(Classes)

R2 := πclass(σname <> class(Ships))

R3 := R1 – R2

Exercise 2.4.3h

R1 := πcountry(σtype=bb(Classes))

R2 := πcountry(σtype=bc(Classes))

R3 := R1 ∩ R2

Exercise 2.4.3i

R1 := πship,result,date(Battles (battle=name) Outcomes)

R2 := ρR2(ship2,result2,date2)(R1)

R3 := R1 (ship=ship2 AND result=damaged AND date < date2) R2

R4 := πship(R3)

No results from sample data.

Exercise 2.4.4a

πclass,country

σbore ≥ 16

Classes

Exercise 2.4.4b

πname

σlaunched < 1921

Ships

Exercise 2.4.4c

πship

σbattle=Denmark Strait AND result=sunk

Outcomes

Exercise 2.4.4d

πname

σlaunched > 1921 AND displacement > 35000

Classes Ships Exercise 2.4.4e

σbattle=Guadalcanal Outcomes Ships

(ship=name)πname,displacement,numGuns

Exercise 2.4.4f Ships Outcomes

πname

πship ρR3(name)

Exercise 2.4.4g Classes Ships

πclass σname <> class πclass

Exercise 2.4.4h

Classes Classes

σtype=bb σtype=bc

πcountry πcountry

Exercise 2.4.4i

Battles Outcomes (battle=name)

πship,result,date

ρR2(ship2,result2,date2)

(ship=ship2 AND result=damaged AND date < date2)

πship

Exercise 2.4.5

The result of the natural join has only one attribute from each pair of equated attributes. On the other hand, the result of the theta-join has both columns of the attributes and their values are identical.

Exercise 2.4.6

Union

If we add a tuple to the arguments of the union operator, we will get all of the tuples of the original result and maybe

the added tuple. If the added tuple is a duplicate tuple, then the set behavior will eliminate that tuple. Thus the union

operator is monotone.

Intersection

If we add a tuple to the arguments of the intersection operator, we will get all of the tuples of the original result and

maybe the added tuple. If the added tuple does not exist in the relation that it is added but does exist in the other

relation, then the result set will include the added tuple. Thus the intersection operator is monotone.

Difference

If we add a tuple to the arguments of the difference operator, we may not get all of the tuples of the original result.

Suppose we have relations R and S and we are computing R – S. Suppose also that tuple t is in R but not in S. The result of R – S would include tuple t. However, if we add tuple t to S, then the new result will not have tuple t. Thus the

difference operator is not monotone.

Projection

If we add a tuple to the arguments of the projection operator, we will get all of the tuples of the original result and the projection of the added tuple. The projection operator only selects columns from the relation and does not affect the rows that are selected. Thus the projection operator is monotone.

Selection

If we add a tuple to the arguments of the selection operator, we will get all of the tuples of the original result and

maybe the added tuple. If the added tuple satisfies the select condition, then it will be added to the new result. The

original tuples are included in the new result because they still satisfy the select condition. Thus the selection operator is monotone.

Cartesian Product

If we add a tuple to the arguments of the Cartesian product operator, we will get all of the tuples of the original result and possibly additional tuples. The Cartesian product pairs the tuples of one relation with the tuples of another relation.

Suppose that we are calculating R x S where R has m tuples and S has n tuples. If we add a tuple to R that is not already in R, then we expect the result of R x S to have (m + 1) * n tuples. Thus the Cartesian product operator is monotone. Natural Joins

If we add a tuple to the arguments of a natural join operator, we will get all of the tuples of the original result and

possibly additional tuples. The new tuple can only create additional successful joins, not less. If, however, the added

tuple cannot successfully join with any of the existing tuples, then we will have zero additional successful joins. Thus the natural join operator is monotone.

Theta Joins

If we add a tuple to the arguments of a theta join operator, we will get all of the tuples of the original result and possibly additional tuples. The theta join can be modeled by a Cartesian product followed by a selection on some condition.

The new tuple can only create additional tuples in the result, not less. If, however, the added tuple does not satisfy the select condition, then no additional tuples will be added to the result. Thus the theta join operator is monotone. Renaming

If we add a tuple to the arguments of a renaming operator, we will get all of the tuples of the original result and the

added tuple. The renaming operator does not have any effect on whether a tuple is selected or not. In fact, the

renaming operator will always return as many tuples as its argument. Thus the renaming operator is monotone. Exercise 2.4.7a

If all the tuples of R and S are different, then the union has n + m tuples, and this number is the maximum possible.

The minimum number of tuples that can appear in the result occurs if every tuple of one relation also appears in the other. Then the union has max(m , n) tuples.

Exercise 2.4.7b

If all the tuples in one relation can pair successfully with all the tuples in the other relation, then the natural join has n * m tuples. This number would be the maximum possible.

The minimum number of tuples that can appear in the result occurs if none of the tuples of one relation can pair successfully with all the tuples in the other relation. Then the natural join has zero tuples.

Exercise 2.4.7c

If the condition C brings back all the tuples of R, then the cross product will contain n * m tuples. This number would be the maximum possible.

The minimum number of tuples that can appear in the result occurs if the condition C brings back none of the tuples of R. Then the cross product has zero tuples.

Exercise 2.4.7d

Assuming that the list of attributes L makes the resulting relation πL(R) and relation S schema compatible, then the maximum possible tuples is n. This happens when all of the tuples of πL(R) are not in S.

The minimum number of tuples that can appear in the result occurs when all of the tuples in πL(R) appear in S. Then the difference has max(n–m , 0) tuples.

Exercise 2.4.8

Defining r as the schema of R and s as the schema of S:

1.πr(R S)

2.R δ(πr∩s(S)) where δ is the duplicate-elimination operator in Section 5.2 pg. 213

3.R – (R –πr(R S))

Exercise 2.4.9

Defining r as the schema of R

1.R - πr(R S)

Exercise 2.4.10

πA1,A2…An(R S)

Exercise 2.5.1a

σspeed < 2.00 AND price > 500(PC) = ?

Model 1011 violates this constraint.

Exercise 2.5.1b

σscreen < 15.4 AND hd < 100 AND price ≥ 1000(Laptop) = ?

Model 2004 violates the constraint.

Exercise 2.5.1c

πmaker(σtype = laptop(Product)) ∩ πmaker(σtype = pc(Product)) = ?

Manufacturers A,B,E violate the constraint.

Exercise 2.5.1d

This complex expression is best seen as a sequence of steps in which we define temporary relations R1 through R4 that stand for nodes of expression trees. Here is the sequence:

R1(maker, model, speed) := πmaker,model,speed(Product PC)

R2(maker, speed) := πmaker,speed(Product Laptop)

R3(model) := πmodel(R1 R1.maker = R2.maker AND R1.speed ≤ R2.speed R2)

R4(model) := πmodel(PC)

The constraint is R4 ? R3

Manufacturers B,C,D violate the constraint.

Exercise 2.5.1e

πmodel(σLaptop.ram > PC.ram AND Laptop.price ≤ PC.price(PC × Laptop)) = ?

Models 2002,2006,2008 violate the constraint.

Exercise 2.5.2a

πclass(σbore > 16(Classes)) = ?

The Yamato class violates the constraint.

Exercise 2.5.2b

πclass(σnumGuns > 9 AND bore > 14(Classes)) = ?

No violations to the constraint.

Exercise 2.5.2c

This complex expression is best seen as a sequence of steps in which we define temporary relations R1 through R5 that stand for nodes of expression trees. Here is the sequence:

R1(class,name) := πclass,name(Classes Ships)

R2(class2,name2) := ρR2(class2,name2)(R1)

R3(class3,name3) := ρR3(class3,name3)(R1)

R4(class,name,class2,name2) := R1 (class = class2 AND name <> name2) R2

R5(class,name,class2,name2,class3,name3) := R4 (class=class3 AND name <> name3 AND name2 <> name3) R3

The constraint is R5 = ?

The Kongo, Iowa and Revenge classes violate the constraint.

Exercise 2.5.2d

πcountry(σtype = bb(Classes)) ∩ πcountry(σtype = bc(Classes)) = ?

Japan and Gt. Britain violate the constraint.

Exercise 2.5.2e

This complex expression is best seen as a sequence of steps in which we define temporary relations R1 through R5 that stand for nodes of expression trees. Here is the sequence:

R1(ship,bat tle,result,class) := πship,battle,result,class(Outcomes (ship = name) Ships)

R2(ship,battle,result,numGuns) := πship,battle,result,numGuns(R1 Classes)

R3(ship,battle) := πship,battle(σnumGuns < 9 AND result = sunk (R2))

R4(ship2,battle2) := ρR4(ship2,battle2)(πship,battle(σnumGuns > 9(R2)))

R5(ship2) := πship2(R3 (battle = battle2) R4)

The constraint is R5 = ?

No violations to the constraint. Since there are some ships in the Outcomes table that are not in the Ships table, we are unable to determine the number of guns on that ship.

Exercise 2.5.3

Defining r as the schema A1,A2,…,A n and s as the schema B1,B2,…,B n:

数据库系统原理及应用教程第四版课后答案

第一章 1、(1)数据:数据用于载荷信息的物理符号。 (2)数据的特征;○1数据有“型”与“值”之分;○2数据受数据类型与取值范围的约束;○3数据有定性表示与定量之分;○4数据应具有载体与多种表现形式。 3、(1)数据管理的功能: ○1组织与保存数据功能,即将收集到的数据合理地分类组织,将其存储在物理载体上,使数据能够长期的被保存; ○2数据维护功能,即根据需要随时进行插入新数据,修改原数据与删除失效数据的操作; ○3数据查询与数据统计功能,即快速的得到需要的正确数据,满足各种使用要求;○4数据的安全与完整性控制功能,即能保护数据的安全与完整性。 (2)数据管理的目标:收集完整的信息,将信息用数据表示,按数据结构合理科学的组织并保存数据;为各种使用快速地提供需要的数据,并保护数据的安全与完整性。 4、(1)数据库:就是数据管理的新方法与技术,她就是一个按数据结构来存储与管理数据的计算机软件系统。 (2)数据库中的数据具有的特点:○1数据库中的数据具有整体性,即数据库中的数据要保持自身完整的数据结构;○2数据库中的数据具有数据共享性,不同的用户可以按各自的用法使用数据库中的数据,多个用户可以同时共享数据库中的数据资源。 5、(1)数据库管理系统:它就是专门用于管理数据库的计算机管理软件。数据库管理系统能够为数据库提供数据的定义、建立、维护、查询与统计等操作功能,并完成对数据完整性、安全性进行操作的功能。 (2)数据库管理系统主要功能:就是数据存储、数据操作与数据控制功能。其数据存储与数据操作就是:数据库的定义功能,指未说明库中的数据情况而进行的建立数据库结构的操作;数据库建立功能,指大批数据录入到数据库的操作,它使得库中含有需要保护的数据记录;数据库维护功能,指对数据的插入、删除与修改操纵,其操作做能满足库中信息变化或更新的需求;数据库查询与统计功能,指通过对数据库的访问,为实际应用提供需要的数据。数据库管理系统的数据控制功能为:数据安全性控制功能,即为了保证数据库的数据安全可靠,防止不合法的使用造成数据库泄露与破坏,也就就是避免数据被人偷瞧、篡改或破坏;数据库完整性控制功能,指为了保证数据库中的数据的正确、有效与相容,防止不合语意的错误数据被输入或输出。 14、(1)数据库系统的软件由几部分组成?数据库系统的软件中包括操作系统(OS)、数据库管理系统(DBMS)、主语言系统、应用程序软件与用户数据库。 (2)作用:①操作系统或汉字操作系统:操作系统就是所有计算机软件的基础,在数据库系统中它起着支持DBMS及主语言系统工作的作用。如果管理的信息中有汉字,则需要中文操作系统的支持,以提供汉字的输入、输出方法与汉字信息的处理方法。②数据库管理系统与主语言系统:数据库管理系统就是为定义、建立、维护、使用及控制数据库而提供的有关数据管理的系统软件。主语言系统就是为应用程序提供的诸如程序控制、数据输入输出、功能函数、图形处理、计算方法等数据处理功能的系统软件。③应用开发工具软件:应用开发工具就是DBMS系统为应用开发人员与最终用户提供的高效率、多功能的应用生成器、第四代计算机语言等各种软件工具.如报表生成器、表单生成器、查询与视图设计器等,它们为数据库系统的开发与使用提供了良好的环境与帮助。④应用系统及数据库:数据库应用系统包括为特定的应用环境建立的数据库、开发的各类应用程序及编写的文档资料,它们就是一个有机整体。通过运行数据库应用系统,可以实现对数据库中数据的维护、查询、管理与处理操作。(3)关系:

数据库系统教程(何玉洁 李宝安 编著)第2章习题答案

第2章数据模型与数据库结构习题答案

1.解释数据模型的概念,为什么要将数据模型分成两个层次? 数据模型(Data Model)是对现实世界数据特征的抽象。 根据模型应用的不同目的,分为两大类。 2.概念层数据模型和组织层数据模型分别是面对什么的数据模型? 概念层数据模型面对现实世界,组织层数据模型面对信息世界。 3.实体之间的联系有哪几种,请为每一种联系举出一个例子。 一对一联系(1:1),例:部门和经理 一对多联系(1:m),例:公司和员工 多对多联系(m:m),例:学生和课程 4.说明实体-联系模型中的实体、属性和联系的概念。 实体是具有公共性质并可相互区分的现实世界对象的集合。 属性是描述实体或联系的性质或特征的数据项。 联系是数据间的关联关系,是客观存在的应用语义链。 5.指明下列实体间联系的种类: 教研室和教师(假设一个教师只属于一个教研室,一个教研室可有多名教师)1:m 商店和顾客m:m 国家和首都1:1 飞机(座位)和乘客1:m 6.数据库包含哪三级模式,试分别说明每一级模式的作用。 内模式描述数据的存储结构。 外模式对现实系统中用户感兴趣的整体数据的局部描述,以满足数据库不同用户对数据的需求。 模式描述数据库中全体数据的逻辑结构和特征,是所有用户的公共数据视图。

7.数据库管理系统提供的两级映像的作用是什么,它带来了哪些功能? 作用:在数据库内部实现对数据库三级模式的联系和转换。 功能:保证了数据库中的数据能够具有较高的逻辑独立性和物理独立性,使数据库应用程序不随数据库数据的逻辑或存储结构的变动而变动。 8.数据库三级模式划分的优点是什么,它能带来哪些数据独立性? 数据库三级模式是对数据的三个抽象级别,它把数据的具体组织留给DBMS管理,使用户能逻辑、抽象地处理数据,而不必关心数据在计算机中的具体表示方式与存储方式。 外模式/模式映像保证了程序与数据的逻辑独立性,模式/内模式映像保证了数据与程序的物理独立性。 *以上内容仅供参考

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

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;

数据库基础教程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) );

《VisualFoxPro6.0简明教程》教学指导书(精)

《Visual FoxPro6.0简明教程》教学指导书 一、教学目的和要求 本课程以Visual Foxpro 6.0 为基础,讲授数据库系统的基本概念和基本理论,使学生了解关系型数据库的基本概念和程序设计方法,能够独立编写VFP程序,并结合数据库的操作管理功能,实现信息管理与查询功能,为后续课程学习奠定基础。 通过本课程的学习,使学生掌握数据库的基本概念、操作、查询;掌握高级语言程序设计及可视化编程功能,掌握可视化编程技巧及技术。学完本课程后,学生应该能够独立编制小型数据库应用程序。 为了便于教师备课,掌握进度,我们给出该课程的教学指导书。但基于各学校的教学安排和情况有所不同,所以很难有统一要求,我们仅以每周3+2学时为例(3节上课,2节上机,按18周设计)写出教学要求。对于每周2+2学时的教学单位有些章节内容可以删略。 二、课程内容及其安排 (课程安排以教育部高职高专规划教材《Visual FoxPro6.0简明教程》为基础) 教学课程内容安排: 第一周 内容:第1章Visual FoxPro 6.0概述 教学目的: 要求学生掌握VFP6.0的功能,VFP6.0系统的软硬件环境,VFP6.0系统的安装及性能指标和VFP6.0文件组成。 教学重点与难点: 1.VFP6.0系统的启动 2. VFP6.0环境介绍 3.VFP6.0文件组成 作业: 1.VFP 6.0的主要特点是什么? 2.VFP 6.0主要使用哪两种菜单? 3.VFP 6.0的数据库文件和数据表文件的扩展名是什么? 第二周 内容:项目管理器 教学目的: 使学生学会项目管理器的建立和使用. 教学重点与难点: 1.项目管理器的建立和界面操作 2. 设计器与生成器的使用 3. 工作目录与搜索路径的建立 作业: 1.什么是项目管理器? 2.如何进入项目管理器 3.项目文件的扩展名是什么?

数据库原理及应用教程第4版习题参考答案

习题参考答案 第1章习题参考答案 一、选择题 1. C 2. B 3. D 4. C 5. D 6. B 7. A 8. B 9. D 10. B 11. C 12. D 13. D 14. D 15. B 16. C 17. D 18. A 19. D 20. A 21. D 22. D 23. C 24. A 25. C 二、填空题 1. 数据库系统阶段 2. 关系 3. 物理独立性 4. 操作系统 5. 数据库管理系统(DBMS) 6. 一对多 7. 独立性 8. 完整性控制 9. 逻辑独立性 10. 关系模型 11. 概念结构(逻辑) 12. 树有向图二维表嵌套和递归 13. 宿主语言(或主语言) 14. 数据字典 15. 单用户结构主从式结构分布式结构客户/服务器结构浏览器/服务器结构 16. 现实世界信息世界计算机世界 三、简答题 1、简述数据库管理技术发展的三个阶段。各阶段的特点是什么? 答:数据库管理技术经历了人工管理阶段、文件系统阶段和数据库系统阶段。 (1)、人工管理数据的特点: A、数据不保存。 B、系统没有专用的软件对数据进行管理。 C、数据不共

享。D、数据不具有独立性。 (2)、文件系统阶段的特点: A、数据以文件的形式长期保存。 B、由文件系统管理数据。 C、程序与数据之间有一定的独立性。 D、文件的形式已经多样化 E、数据具有一定的共享性 (3)、数据库系统管理阶段特点: A、数据结构化。 B、数据共享性高、冗余度底。 C、数据独立性高。 D、有统一的数据控制功能。 2、从程序和数据之间的关系来分析文件系统和数据库系统之间的区别和联系 答:数据管理的规模日趋增大,数据量急剧增加,文件管理系统已不能适应要求,数据库管理技术为用户提供了更广泛的数据共享和更高的数据独立性,进一步减少了数据的余度,并为用户提供了方便的操作使用接口。数据库系统对数据的管理方式与文件管理系统不同,它把所有应用程序中使用的数据汇集起来,以记录为单位存储,在数据库管理系统的监督和管理下使用,因此数据库中的数据是集成的,每个用户享用其中的一部分。 3、简述数据库、数据库管理系统、数据库系统三个概念的含义和联系。答:数据库是指存储在计算机内、有组织的、可共享的数据集合。 数据库管理系统是软件系统的一个重要组成部分,它通过借助操作系统完成对硬件的访问,并对数据库的数据进行存取、维护和管理。 数据库系统是指计算机系统中引入数据库后的系统构成。它主要由数据库、数据库用户、计算机硬件系统和计算机软件系统几部分组成。 三者的联系是:数据库系统包括数据库和数据库管理系统。数据库系统主要通过数据库管理系统对数据库进行管理的。 4、数据库系统包括哪几个主要组成部分?各部分的功能是什么?画出整个数据库系统的层次结构图。 答:数据库系统包括:数据库、数据库用户、软件系统和硬件系统。 数据库主要是来保存数据的。 数据库用户是对数据库进行使用的人,主要对数据库进行存储、维护和检索等操作。 软件系统主要完成对数据库的资源管理、完成各种操作请求。 硬件系统主要完成数据库的一些物理上的操作,如物理存储、输入输出等。

数据库系统教程试卷-A

《数据库系统教程》试卷(A卷,2005.1) 一、单项选择题(本大题共15小题,共25分。 1.DBS具有较高的数据独立性,是因为DBS采用了 [ B ] A.嵌入式语言B.三级模式结构C.DD D.六个层次的存储介质 2.在层次、网状模型中,起导航数据作用的是[ A ] A.指针B.关键码C.DD D.索引 3.设关系R(A,B,C)和关系S(B,C,D), 那么与R?S等价的关系代数表达式是 2=1 [ B ] A.σ2=4(R?S)B.σ2=4(R×S)C.σ2=1(R?S) D.σ2=1(R×S)4.设关系R和S的结构相同,分别有m和n个元组,那么R-S操作的结果中元组个数为 [ C ] A.为m-n B.为m C.小于等于m D.小于等于(m-n)5.元组比较操作(a1,a2)>=(b1,b2)的意义是 [ D ] A.(a1>=b1)AND(a2>=b2)B.(a1>=b1)OR((a1=b1)AND(a2>=b2)) C.(a1>b1)AND((a1=b1)AND(a2>=b2))D.(a1>b1)OR((a1=b1)AND(a2>=b2))

6.设有关系R(A,B,C)的值如下: A B C 5 6 5 6 7 5 6 8 6 下列叙述正确的是[ B ] A.函数依赖C→A在上述关系中成立B.函数依赖AB→C在上述关系中成立 C.函数依赖A→C在上述关系中成立D.函数依赖C→AB在上述关系中成立 7.设关系模式R(A,B,C,D),F是R上成立的FD集,F={ A→C,BC→D },那么ρ={ ABD,AC }相对于F [ B ] A.是无损联接分解,也是保持FD的分解 B.是无损联接分解,但不保持FD的分解 C.不是无损联接分解,但保持FD的分解 D.既不是无损联接分解,也不保持FD的分解 8.概念设计的结果得到的是概念模式。概念模式是[ D ] A.与DBMS有关的B.与硬件有关的 C.独立于DBMS的D.独立于DBMS和硬件的

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

一、选择题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成立。

数据库系统简明教程填空题答案

第一章 1数据库具有(永久储存,有组织,可共享)三个基本特点。 2数据库管理系统是数据库系统的一个重要组成部分,他的功能包括(数据定义功能,数据操纵功能,数据库的运行管理,数据的建立和维护) 3数据库系统是指在计算机系统中引入数据库后的系统,一般由(数据库,数据库管理系统,应用系统,数据库管理员)构成 4数据库管理技术的发展是与计算机技术及其应用的发展联系在一起的,他经历三个阶段(人工管理阶段,文件系统阶段,数据库系统阶段) 5数据库具有数据结构化、最小的冗余度、较高的独立性的特点 6DBMS还必须提供(数据的安全性保护、数据的完整性检查、并发控制、数据库恢复)等数据控制功能 7模式是数据库中全体数据的逻辑结构和特征的描述,它仅仅涉及到(型)的描述,不涉及到具体的值 8三级模式之间的两层映像保正了数据库系统中的数据具有较高的(逻辑独立性和物理独立性) 第二章 1、根据模型应用的不同目的,可以将这些模型划分为两类,它们分别属于两个不同的层次。第一类是(概念模型),第二类是(数据模型)。 2、数据模型的三要素是指(数据结构)、(数据操作)和(完整性约束)。实际数据库 系统中所支持的主要数据模型是(层次模型)(网状模型)和(关系模型) 3、数据模型中的(数据结构)是对数据系统的静态特征描述,包括数据结构和数据间联系的描述,(数据操作)是对数据库系统的动态特征描述,是一组定义在数据上的操作, 包括操作的涵义、操作符]、运算规划及其语言等。 4、用树型结构表示实体类型及实体间联系的数据模型称为(层次),上一层的父结点 和下一层的子结点之间的联系是(一对多)的联系。 5、用有向图结构表示实体类型及实体间联系的数据模型称为(网状模型),数据之间的联系通常用(指针)实现 6、(关系模型)是目前最常用也是最重要的一种数据模型。采用该模型作为数据的组织方式的数据库系统称为(关系数据库系统) 7、关系的完整性约束条件包括三大类(实体完整性)(参照完整性)和(用户定义完整性)第三章习题 1、关系数据模型中,二维表的行称为(元组)。 2、用户选作元组标识的一个候选码为(主码),其属性不能取(相同) 3、关系代数运算中,传统的集合运算有(并)、(交)(差)(笛卡尔积)。 4、关系代数运算中,基本的运算是并、差、选择、投影、笛卡尔积 5、关系代数运算中,专门的关系运算有(选择)、(投影)(连接) 6、关系数据库中基于数学上的两类运算是(关系代数)和(关系演算) 7、关系代数中,从两个关系中找出相同元组的运算称为(交)运算。 8.R》《S表示R与S的(自然连接) 第四章 1、SQL的中文全称是(结构化查询语言)。 2、SQL语言除了具有数据查询和数据操纵功能之外,还具有(数据定义)和(数据控制)的功能,它是一个综合性的功能强大的语言。 3、在关系数据库标准SQL中,实现数据检索的语句命令是(select)

(完整word版)数据库系统原理及应用教程第四版课后答案

第一章 1、(1)数据:数据用于载荷信息的物理符号。 (2)数据的特征;○1数据有“型”和“值”之分;○2数据受数据类型和取值范围的约束;○3数据有定性表示和定量之分;○4数据应具有载体和多种表现形式。 3、(1)数据管理的功能:○1组织和保存数据功能,即将收集到的数据合理地分类组织,将其存储在物理载体上,使数据能够长期的被保存;○2数据维护功能,即根据需要随时进行插入新数据,修改原数据和删除失效数据的操作;○3数据查询和数据统计功能,即快速的得到需要的正确数据,满足各种使用要求;○4数据的安全和完整性控制功能,即能保护数据的安全和完整性。 (2)数据管理的目标:收集完整的信息,将信息用数据表示,按数据结构合理科学的组织并保存数据;为各种使用快速地提供需要的数据,并保护数据的安全和完整性。 4、(1)数据库:是数据管理的新方法和技术,他是一个按数据结构来存储和管理数据的计算机软件系统。 (2)数据库中的数据具有的特点:○1数据库中的数据具有整体性,即数据库中的数据要保持自身完整的数据结构;○2数据库中的数据具有数据共享性,不同的用户可以按各自的用法使用数据库中的数据,多个用户可以同时共享数据库中的数据资源。 5、(1)数据库管理系统:它是专门用于管理数据库的计算机管理软件。数据库管理系统能够为数据库提供数据的定义、建立、维护、查询和统计等操作功能,并完成对数据完整性、安全性进行操作的功能。 (2)数据库管理系统主要功能:是数据存储、数据操作和数据控制功能。其数据存储和数据操作是:数据库的定义功能,指未说明库中的数据情况而进行的建立数据库结构的操作;数据库建立功能,指大批数据录入到数据库的操作,它使得库中含有需要保护的数据记录;数据库维护功能,指对数据的插入、删除和修改操纵,其操作做能满足库中信息变化或更新的需求;数据库查询和统计功能,指通过对数据库的访问,为实际应用提供需要的数据。数据库管理系统的数据控制功能为:数据安全性控制功能,即为了保证数据库的数据安全可靠,防止不合法的使用造成数据库泄露和破坏,也就是避免数据被人偷看、篡改或破坏;数据库完整性控制功能,指为了保证数据库中的数据的正确、有效和相容,防止不合语意的错误数据被输入或输出。 14、(1)数据库系统的软件由几部分组成?数据库系统的软件中包括操作系统(OS)、数据库管理系统(DBMS)、主语言系统、应用程序软件和用户数据库。 (2)作用:①操作系统或汉字操作系统:操作系统是所有计算机软件的基础,在数据库系统中它起着支持DBMS及主语言系统工作的作用。如果管理的信息中有汉字,则需要中文操作系统的支持,以提供汉字的输入、输出方法和汉字信息的处理方法。②数据库管理系统和主语言系统:数据库管理系统是为定义、建立、维护、使用及控制数据库而提供的有关数据管理的系统软件。主语言系统是为应用程序提供的诸如程序控制、数据输入输出、功能函数、图形处理、计算方法等数据处理功能的系统软件。③应用开发工具软件:应用开发工具是DBMS系统为应用开发人员和最终用户提供的高效率、多功能的应用生成器、第四代计算机语言等各种软件工具.如报表生成器、表单生成器、查询和视图设计器等,它们为数据库系统的开发和使用提供了良好的环境和帮助。④应用系统及数据库:数据库应用系统包括为特定的应用环境建立的数据库、开发的各类应用程序及编写的文档资料,它们是一个有机整体。通过运行数据库应用系统,可以实现对数据库中数据的维护、查询、管理和处理操作。(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;

2019年大学《数据库原理及应用教程》试题及答案

《数据库原理及应用教程》试题及答案 一、选择题 1、下面叙述正确的是(C) A. 算法的执行效率与数据的存储结构无关 B. 算法的空间复杂度是指算法程序中指令(或语句)的条数 C. 算法的有穷性是指算法必须能在执行有限个步骤之后终止 D. 以上三种描述都不对 (2) 以下数据结构中不属于线性数据结构的是(C) A. 队列 B. 线性表 C. 二叉树 D. 栈 (3) 在一棵二叉树上第5层的结点数最多是(B) 注:由公式2k-1得 A. 8 B. 16 C. 32 D. 15 (4) 下面描述中,符合结构化程序设计风格的是(A) A. 使用顺序、选择和重复(循环)三种基本控制结构表示程序的控制逻辑 B. 模块只有一个入口,可以有多个出口 C. 注重提高程序的执行效率 D. 不使用goto语句 (5) 下面概念中,不属于面向对象方法的是(D) 注:P55-58 A. 对象 B. 继承 C. 类 D. 过程调用 (6) 在结构化方法中,用数据流程图(DFD)作为描述工具的软件开发阶段是 (B) A. 可行性分析 B. 需求分析 C. 详细设计 D. 程序编码 (7) 在软件开发中,下面任务不属于设计阶段的是(D) A. 数据结构设计 B. 给出系统模块结构

C. 定义模块算法 D. 定义需求并建立系统模型 (8) 数据库系统的核心是(B) A. 数据模型 B. 数据库管理系统 C. 软件工具 D. 数据库 (9) 下列叙述中正确的是(C) A.数据库是一个独立的系统,不需要操作系统的支持 B.数据库设计是指设计数据库管理系统 C.数据库技术的根本目标是要解决数据共享的问题 D.数据库系统中,数据的物理结构必须与逻辑结构一致 (10) 下列模式中,能够给出数据库物理存储结构与物理存取方法的是(A) 注:P108 A. 内模式 B. 外模式 C. 概念模式 D. 逻辑模式 (11) 算法的时间复杂度是指(C) A. 执行算法程序所需要的时间 B. 算法程序的长度 C. 算法执行过程中所需要的基本运算次数 D. 算法程序中的指令条数 (12) 算法的空间复杂度是指(D) A. 算法程序的长度 B. 算法程序中的指令条数 C. 算法程序所占的存储空间 D. 算法执行过程中所需要的存储空间 (13) 设一棵完全二叉树共有699个结点,则在该二叉树中的叶子结点数为(B) 注:利用公式n=n0+n1+n2、n0=n2+1和完全二叉数的特点可求出 A. 349 B. 350 C. 255 D. 351 (14) 结构化程序设计主要强调的是(B) A.程序的规模 B.程序的易读性

数据库系统教程试卷-A

一、单项选择题(本大题共15小题,共25分。 1.DBS具有较高的数据独立性,是因为DBS采用了[ B ] A.嵌入式语言B.三级模式结构C.DD D.六个层次的存储介质 2.在层次、网状模型中,起导航数据作用的是[ A ] A.指针B.关键码C.DD D.索引 3.设关系R(A,B,C)和关系S(B,C,D), 那么与R?S等价的关系 代数表达式是[ B ] A.σ2=4(R?S)B.σ2=4(R×S)C.σ2=1(R?S)D.σ2=1(R×S) 4.设关系R和S的结构相同,分别有m和n个元组,那么R-S操作的结果中元组个数为[ C ] A.为m-n B.为m C.小于等于m D.小于等于(m-n) 5.元组比较操作(a 1,a 2 )>=(b 1 ,b 2 )的意义是[ D] A.(a 1>=b 1 )AND(a 2 >=b 2 )B.(a 1 >=b 1 )OR((a 1 =b 1 )AND(a 2 >=b 2 )) C.(a 1>b 1 )AND((a 1 =b 1 )AND(a 2 >=b 2 )) D.(a 1 >b 1 )OR((a 1 =b 1 )AND(a 2 >=b 2 )) 6.设有关系R(A,B,C)的值如下: A B C 5 6 5 6 7 5 6 8 6 下列叙述正确的是[ B ] A.函数依赖C→A在上述关系中成立B.函数依赖AB→C在上述关系中成立 C.函数依赖A→C在上述关系中成立D.函数依赖C→AB在上述关系中成立 7.设关系模式R(A,B,C,D),F是R上成立的FD集,F={ A→C,BC→D },那么ρ={ ABD,AC }相对于F [ B ] A.是无损联接分解,也是保持FD的分解 B.是无损联接分解,但不保持FD的分解 C.不是无损联接分解,但保持FD的分解 D.既不是无损联接分解,也不保持FD的分解 8.概念设计的结果得到的是概念模式。概念模式是[ D] A.与DBMS有关的B.与硬件有关的 C.独立于DBMS的D.独立于DBMS和硬件的 9.在有关“弱实体”的叙述中,不正确的是[ C ] A.弱实体的存在以父实体的存在为前提 B.弱实体依赖于父实体的存在 C.父实体与弱实体的联系可以是1:1、1:N或M:N D.父实体与弱实体的联系只能是1:1或1:N 10.有15个实体类型,并且它们之间存在着15个不同的二元联系,其中5个是1:1联系类型,5个是1:N联系类型,5个M:N联系类型,那么根据转换规则,这个ER结构转换成的关系模式有[ D ] 2=1

《数据库原理及应用》教学大纲.

《数据库原理及应用》教学大纲 课程编号: 课程英文名称:Principle And Application of Database 课程类别:专业基础课程课程性质:必修课 学分: 3.5 总学时:64 理论学时:48 实验学时:16 开课对象:计算机应用与维护(专科) 开课分院、系:电子信息分院,计算机系 一、课程的性质、目的和任务 数据库是当前计算机领域中应用最广泛、发展最迅速的技术,数据库原理与应用课程是计算机相关专业的专业基础课。本课程的任务是培养学生数据库技术的综合应用能力。本课程主要介绍数据库的基本概念、数据模型,SQL语言,关系数据库及关系数据库理论、数据库设计方法,数据库保护以及SQL Server关系数据库系统的应用。通过本课程的学习,使学生掌握数据库的基本理论和数据库的应用技术,为后续课程学习以及今后从事数据库系统的开发打下一定的基础。 二、先修课程及预备知识 先修课程:计算机文化基础、程序设计语言 三、课程内容、基本要求及学时分配 1.数据库系统基本概念(4学时) [1]基本概念 [2]数据库技术及发展 [3]数据库系统的结构 基本要求: ①了解数据库技术的发展情况,理解数据库系统的结构。 ②掌握数据库的基本概念。 2.数据模型与概念模型(4学时) [1]信息的三种世界 [2]概念模型 [3]数据模型 基本要求: ①了解信息的三种世界,深刻理解概念模型和数据模型。 ②掌握概念模型和数据模型的表示方法。 3.关系数据库(4学时) [1]关系模型及其定义 [2]关系代数 基本要求: ①了解关系模型的数据结构,关系模型的完整性约束。 ②掌握关系代数的运算方法。

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

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系统需求分析............................................................................ 1.2项目规划.................................................................................... 1.3系统功能结构分析.................................................................... 1.4设计目的分析............................................................................ 1.5开发及运行环境分析................................................................ 2.数据库系统设计................................. 2.1数据表的设计 ........................................................................... 3.应用程序设计.................................. 3.1界面设置 ................................................................................... 3.2关键函数代码 ........................................................................... 4.系统测试...................................... 4.1系统连接SQL2005方法 ........................................................... 5.设计体会......................................

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