判断题+7个大题

郭哥非常好啊,直接提出了:“基本都见过的题,课件上的例题”

所以我这里考虑把PPT上出现过的Examples都摘出来。

可以划分一下内容层面

  • Relation Model(关系模型),关系代数之类的
  • SQL语句相关的应用,Chapter 3 - 5都是在讲这个
  • E-R模型E-R Model
  • 关系模型,根据E-R转关系模型,正则化,3NF,BCNF之类
  • 索引Index
  • 查询优化
  • 事务:Conflict Serializability(如何识别?如何画前趋图),Recoverability(如何识别是否可恢复,是否级联回滚)
  • 并发控制

这里应该摘出来PPT中所有的Examples和例题,如果有缺漏可以找我补:D

Chapter 2 Relational Model

Chapter 3 SQL

P24

Q:Find **names of all instructors ** who have taught some course and the course_id

A:

select name, course_id
from instructor, teaches
where instructor.ID = teaches.ID

Q:Find names of all instructors in Art department who have taught some course and the course_id

A:

select name, course_id
from instructor, teaches
where instructor.dept_name = "Art"
and instructor.ID = teaches.ID
  • 子句from 包括多个关系表
    • 要在where子句中加入连接条件
    • 防止出现costly 多表笛卡尔积操作
  • 频繁执行SQL查询,from子句表的个数不要过多
    • 避免耗时费力的多表连接操作
    • 不要超过4个表
    • 如果频繁执行查询设计张表,将这 N张表的数据进行合并

Chapter 4 Intermediate SQL

Not Found

Chapter 5 Advanced SQL

DBAS = users + application programs + DBMS + DB 期末题型-Chapter5 DBAS结构图 期末题型-Chapter5-SQL Function 期末题型-Chapter5-SQL Functions 期末题型-Chapter5-SQL Procedures 期末题型-Chapter5-SQL Procedures-1 Triggers例题 期末题型-Chapter5-Trigger例题 期末题型-Chapter5-Trigger例题-1

Chapter 6 Database Design Using the E-R Model

期末题型-Chapter6-例题1-1 期末题型-Chapter6-例题1-2 期末题型-Chapter6-例题1-3

答案: E-R diagrams 期末题型-Chapter6-例题1答案

The E-R diagrams is then reduced to some relational tables

  • For entity set Customer and its multi-valued attribute ship-to addresses, there are two tables

    • customer=(C-number, c-name, discount, balance)
    • ship-to-addresses = (C-number, ship-to-addresses)
  • For entity set Order and its composite attribute date which should be decomposed , there is a table

    • order1=(O-number, ship-to-address, year, month, day) 复合属性需要解开
  • For entity set Product, there is a table

    • product=(P-number, p-name, plant, quantity-on-hand)
  • For relationship set make, there are no descriptive attributes, mapping cardinality from Customer to Order is one-to-many, and Order totally participate make. So, make should not be reduced into a separate table, and can be represented by adding the primary key C-number of Customer , that is C-number into the table order

    • order2=(O-number, C-number, ship-to-address, year, month, day)
    • note: the primary key C-number is already in the table order

期末题型-Chapter6-例题1答案2

期末题型-Chapter6-例题1答案3

Chapter 7 Relational Database Design:Schema Normalization

本章的习题类型 期末题型-Chapter7-习题类型 期末题型-Chapter7-习题类型2

期末题型-Chapter7-例题1 Page25,这是函数依赖相关的知识

Whenever two tuples t1 and t2 agree on the attributes ,also agree on the attributes 表现为数据项的相等,但是本质上是数据之间语义的关系,比如身份证号确定一个人

A:t2和t3的属性A相等,但是对应的属性B不相等,故A不能确定B B:AC的t2和t3相等,但是对应的B属性不相等 C:BC没有相等的行 D:B的t1和t3相等,但是对应的C不相等,故

Page 39, Lossless Decomposition check

A decomposition of R into and is lossless join if and only if at least one of the following dependencies is in :

  • If only holds, then is the primary key of , and the foreign key of .

  • It is a sufficient condition

不同子表间存在外键关联 期末题型-Chapter7-Lossless_check 期末题型-Chapter7-Lossless_2

Page46, 2NF Examples

期末题型-Chapter7-2NF-1 期末题型-Chapter7-2NF-2 Page49 BCNF Example 期末题型-Chapter7-BCNF-1 Page50, Decomposing a schema into BCNF 期末题型-Chapter7-Decompose a schema into BCNF 期末题型-Chapter7-Decompose a schema into BCNF-2 Not always possible to achieve both BCNF and dependency preservation

转为BCNF范式不一定能保持所有的函数依赖

Page58, 3NF example 期末题型-Chapter7-3NF-1

Page65, SQL for FD Judgment example

期末题型-Chapter7-SQL-for-FD-Judgement 期末题型-Chapter7-SQL-for-FD-Judgement-2 期末题型-Chapter7-SQL-for-FD-Maintenance

Page 72, Example of 期末题型-Chapter7-Example-of-F闭包 期末题型-Chapter7-Example-of-F闭包2

Page 76, Example of Attributes Set Closure 期末题型-Chapter7-Example of Attribute Set Closure Closure of Attributes Sets

Page 94, Computing a Cannonical Cover 期末题型-Chapter7 Computing a Canonical Cover Testing for Dependency Preservation的相关例子比较简单,只需要从每个被分解出的Schema的FD去尝试推导原Schema的FD即可,即是否等于

Page113, BCNF decomposition

期末题型-Chapter7-BCNF decomposition 1 期末题型-Chapter7 BCNF decomposition 2 期末题型-Chapter7 BCNF decomposition 3 期末题型-Chapter7-BCNF decomposition 4 期末题型-Chapter7-BCNF decomposition 5 期末题型-Chapter7 BCNF decomposition 6 期末题型-Chapter7-BCNF decomposition 7

Page 127, 3NF decomposition Example 期末题型-Chapter-3NF decomposition 1 期末题型-Chapter7-3NF decomposition 2 期末题型-Chapter7-3NF decomposition 3 期末题型-Chapter7 3NF decomposition 4 期末题型-Chapter7-3NF decomposition 5

Page 135 求候选键 期末题型-Chapter7 求候选键1 期末题型-Chapter7-计算候选键 期末题型-Chapter7-计算候选键3

Chapter13 Data Storage Structures

Chapter 14 Indexing

重点应该是这几张图 期末题型-Chapter14-重点1 期末题型-Chapter14-重点2 期末题型-Chapter14-重点3 例题

期末题型-Chapter14-例题1 期末题型-Chapter14-例题1-2 期末题型-Chapter14-例题1-3 期末题型-Chapter14-例题1-4 期末题型-Chapter14-例题1-5

Chapter 15 Query Processing

Not Found

Chapter 16 Query Optimization

期末题型-Chapter 16-Example one 期末题型-Chapter16-Example two 期末题型-Chapter 16-Example three Join Order 例子 期末题型-Chapter16-Join order例子

Heuristic Optimization

期末题型-Chapter16-启发式优化例子1 期末题型-Chapter16-启发式优化例子1-2 期末题型-Chapter16-启发式优化例子1-3 期末题型-Chapter16-启发式优化例子1-4 期末题型-Chapter16-启发式优化例子1-5

期末题型-Chapter16-启发式优化例子2-1 期末题型-Chapter16-启发式优化例子2-2 期末题型-Chapter16-启发式优化例子2-3 期末题型-Chapter16-启发式优化例子2-4 例子3 期末题型-Chapter16-启发式优化例子3-1 期末题型-Chapter16-启发式优化例子3-2 例子4 期末题型-Chapter16-启发式优化例子4-1 期末题型-Chapter16-启发式优化例子4-2 期末题型-Chapter16-启发式优化例子4-3

Chapter 17 Transactions

期末题型-Chapter17-例题1-1 期末题型-Chapter17-例题1-2 期末题型-Chapter17-例题1-3 期末题型-Chapter17-例题1-4 期末题型-Chapter17-例题1-5

Chapter 18

Only at page 69

期末题型-Chapter18-例题