Part I. (30 Points ,2 points for each problem)
1.
Database system can solve the data redundancy and inconsistency problems with fileprocessing systems.
2.
A foreign key is a referential constraint between two tables.
3.
When a client requests a record that contains a BLOB (binary large object), the database server that receives the request should return the entire record at a time.
4.
SQL allows you to not only create a new table, but also to delete an existing table from the database.
5.
The relation R(A,B,C,D) consists of ONLY the tuples that are listed and NO other tuples.
6.
7.
Which statement is true?
8.
True or false? Primary key can be null, foreign keys can not be null.
9.
![](https://i-blog.csdnimg.cn/blog_migrate/35370be9a2cc7c03966da8e3dabe166b.png)
![](https://i-blog.csdnimg.cn/blog_migrate/0ae6ebdf8dfa3e3c67ad25ff21d45dab.png)
10.
What does the following SQL statement do?
11.
Which is the benefit of denormalization?
12.
Which is true?
13.
Which of the following is false?
14.
![](https://i-blog.csdnimg.cn/blog_migrate/94b490d82b52a5216a573703c7c95c67.png)
15.
Which statement about the key is correct?
Part II. Relational Model (10*4=40 Points)
Chapter 2 Introduction to the Relational Model
英文 | 中文 | 注释 |
---|---|---|
Table
| 表 | |
Relation
| 关系 | |
Tuple
| 元组 | |
Null value
| 空值 | |
Database schema
| 数据库模式 | |
Database instance
| 数据库实例 | |
Relation schema
| 关系模式 | |
Relation instance
| 关系实例 | |
Keys
| 码 | |
Superkey
| 超码 | 一个或多个属性的集合, 这些属性的组合可以使我们在一个关系中唯一地标识一个元组 |
Candidate key
| 候选码 | 任意真子集都不能成为超码的最小超码 |
Primary key
| 主码 | 用来在一个关系中区分不同元组的候选码 |
Foreign key
| 外码 | 一个关系模式在它的属性中包含另一个关系模式的主码 |
Referencing relation
| 参照关系 | |
Referenced relation
| 被参照关系 | |
Attribute
| 属性 | |
Domain
| 域 | |
Atomic domain
| 原子域 | |
Referential integrity constraint
| 参照完整性约束 | 参照完整性约束要求在参照关系中任意元组在特定属性上的取值必然等于被参照关系中某个元组在特定属性上的取值 |
Schema diagram
| 模式图 | 表示一个含有主码和外码依赖的数据库模式 |
Query language
| 查询语言 | |
Procedural language
| 过程化语言 | |
Nonprocedural language
| 非过程化语言 | |
Operations on relations
| 关系运算 | |
Selection of tuples
| 选择元组 | |
Selection of attributes
| 选择属性 | |
Natural join
| 自然连接 | |
Cartesian product
| 笛卡尔积 | |
Set operations
| 集合运算 | |
Relational algebra
| 关系代数 |
![](https://i-blog.csdnimg.cn/blog_migrate/1e93135d45d641c0aa1c9585fd6510ba.png)
Question 1: Please write down relational algebra for following queries.
Question 2: Please write down SQL statements for following queries.
Part III. Entity-Relationship Model (15 Points)
Chap 7
英文 | 中文 | 注释 |
---|---|---|
Entity-relationship data model
| 实体-联系数据模型 | |
Entity and entity set
| 实体和实体集 | ![]() |
Attributes
| 属性 | |
Domain
| 域 | |
Simple and composite attributes
| 简单和复合属性 | |
Single-valued and multivalued attributes
| 单值和多值属性 | |
Null value
| 空值 | |
Derived attribute
| 派生属性 | |
Superkey, candidate key, and primary key
| 超码、候选码以及主码 | |
Relationship and relationship set
| 联系和联系集 | ![]() |
Binary relationship set
| 二元联系集 | |
Degree of relationship set
| 联系集的度 | |
Descriptive attributes
| 描述性属性 | |
Superkey, candidate key, and primary key
| 超码、候选码以及主码 | |
Role
| 角色 | |
Recursive relationship set
| 自环联系集 | |
E-R
diagram
| E-R图 | |
Mapping cardinality
| 映射基数 | |
One-to-one relationship
| 一对一联系 | ![]() |
One-to-many relationship
| 一对多联系 | |
Many-to-one relationship
| 多对一联系 | ![]() |
Many-to-many relationship
| 多对多联系 | ![]() |
Participation
| 参与 | |
Total participation
| 全部参与 | ![]() |
Partial participation
| 部分参与 | |
Weak entity sets and strong entity sets
| 弱实体集和强实体集 | |
Discriminator attributes
| 分辨符属性 | |
Identifying relationship
| 标识联系 | |
Specialization and generalization
| 特化和概化 | ![]() |
Superclass and subclass
| 超类和子类 | |
Attribute inheritance
| 属性继承 | |
Single and multiple inheritance
| 单和多继承 | |
Condition-defifined and userdefined membership
| 条件定义和用户定义的成员资格 | |
Disjoint and overlapping generalization
| 不相交概化和重叠概化 | ![]() ![]() |
Total and partial generalization
| 全部概化和部分概化 | |
Aggregation
| 聚集 | |
UML
| UML | |
UML
class diagram
| UML类图 |
Model the entities and relationships (including attributes and properties of relationships) described below in an ERdiagram.
Write down any assumptions you make.
Convert the ERdiagram to relational schema and indicate the primary key and foreign keys of each relation.
对ER中描述的实体和关系(包括关系的属性和属性)进行建模图表。
写下你的假设。
转换ER关系模式的关系图,并指示每个关系的主键和外键。
你的任务是为提供热门电视剧的在线视频服务设计一个数据库(连续剧).
以下是申请说明:
每个系列都有一个名称和描述。
我们想记录常规演员的信息(演员)系列的一部分。
换句话说,对于这个系列中的每一个主要演员,我们都要记录他/她的名字和地址。
你可以假设演员阵容没有改变。
每个系列都有很多集(集).
每集都有一个集号
它第一次播出的年份和日期,以及每集的长度(以分钟为单位)。
插曲编号唯一地标识了与该系列相关的一个插曲,但是两个不同的系列可以具有相同的插曲编号。
注册观众可以评论任何一集。
对于每条评论,我们要记录其发布日期和内容。
对于每个注册的查看器,我们要记录他/她的用户名和密码。
Part IV. Relational Database design (15 Points, 5 points for each problem)
Chap 8 Relational Database Design
英文 | 中文 | 注释 |
---|---|---|
E-R model and normalization
| E-R模型和规范化 | |
Decomposition
| 分解 | |
Functional dependencies
| 函数依赖 | |
Lossless decomposition
| 无损分解 | |
Atomic domains
| 原子域 | |
First normal form (1NF)
| 第一范式(1NF) | |
Legal relations
| 合法关系 | |
Superkey
| 超码 | |
R
satisfifies
F
| R满足F | |
F
holds on
R
| F在R上成立 | |
Boyce –Codd normal form
(
BCNF
)
| 范式(BCNF) | 具有函数依赖集F的关系模式R属于BCNF的条件是,对F+中所有形如α→β的函数依赖(其中α 下面至少有一项成立: α→β是平凡的函数依赖(即,β α是模式R的一个超码 |
Dependency preservation
| 保持依赖 | ![]() |
Third normal form (
3NF
)
| 第三范式(3NF) | 具有函数依赖集F的关系模式R属于第三范式的条件是,对F+中所有形如α→β的函数依赖(其中α 以下至少一项成立: α→β是一个平凡的函数依赖(即,β α是R的一个超码 β-α中的每个属性A都包含于R的一个候选码中 |
Trivial functional dependencies
| 平凡的函数依赖 | |
Closure of a set of functional dependencies
| 函数依赖集的闭包 | |
Armstrong’s axioms
| Armstrong公理 | |
Closure of attribute sets
| 属性集闭包 | 令α为一个属性集,我们将函数依赖集F下被α函数确定的所有属性集的集合成为F下α的闭包,记为α+ |
Restriction of
F
to
R
i
| F在Ri上的限定 | |
Canonical cover
| 正则覆盖 | |
Extraneous attributes
| 无关属性 | |
BCNF
decomposition algorithm
| BCNF分解算法 | ![]() |
3NF
decomposition algorithm
| 3NF分解算法 | ![]() |
Multivalued dependencies
| 多值依赖 | |
Fourth normal form (
4NF
)
| 第四范式(4NF) | |
Restriction of a multivalued
dependency
| 多值依赖的限定 | |
Project-join normal form(
PJNF
)
| 投影-连接范式(PJNF) | |
Domain-key normal form(
DKNF
)
| 域-码范式(DKNF) | |
Universalrelation
| 泛关系 | |
Unique-roleassumption
| 唯一角色假设 | |
Denormalization
| 去规范化 |
1.
![](https://i-blog.csdnimg.cn/blog_migrate/6aa091e80b0bca93adc6af372fe851db.png)
2.
![](https://i-blog.csdnimg.cn/blog_migrate/4a3dd2823fdace238cba9f5fe6c962e8.png)
3.
![](https://i-blog.csdnimg.cn/blog_migrate/3c9550d20b7f61b439876acdb1ada84a.png)
Answer
III
IV-1
IV-2
IV-3