Download 2011題目

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Concurrency control wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Database wikipedia , lookup

Functional Database Model wikipedia , lookup

Clusterpoint wikipedia , lookup

ContactPoint wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
國立東華大學試題: 資料庫管理
(每題10分;共100分)
資訊管理學系2011.06.21
Example:
Banking
Database
1. branch
4. borrower
分公司
貸款戶
Wei-Pang Yang, IM.NDHU, 2010
2. customer 客戶(存款戶,貸款戶) 3. depositor 存款戶
5. account
存款帳
Introduction to Database System
6. loan
貸款帳
2011 Final Test-1
Question 1: Terms Explanation
(10%)
1) Semantic Data Model
2) Logical Database Design
3) Functional Dependency
4) Update Anomalies
5) Minimize the number of Disk Access
Wei-Pang Yang, IM.NDHU, 2010
Introduction to Database System
2011 Final Test-2
Question 2: Real-world vs. E-R Model vs. Tables (10%)
 試討論 Real-world, E-R Model , 及Tables 之關係
The real-world enterprise
Semantic Data Model:
Entity-Relationship (E-R) Data Model
1. branch
分公司

Wei-Pang Yang, IM.NDHU, 2010
2. customer
客戶(存款戶,貸款戶)

Introduction to Database System
3. depositor
存款戶

2011 Final Test-3
Question 3: E-R Model

(10%)
Suppose we have a relationship set borrower between customer
and loan as shown in Figure 1.
1) Draw an E-R Diagram for the application system in Figure 1.
(Please show the mapping cardinalities.)
2) What does it mean by the total participator, and which one is it?
3) What does it mean by the partial participator, and which one is it?
customer
Figure 1.
E1
E2
E3
E4
loan
.
.
.
.
.
.
.
Relationship Set: borrower
Wei-Pang Yang, IM.NDHU, 2010
Introduction to Database System
2011 Final Test-4
Question 4: E-R Model  Tables

(10%)
E.g. Consider weak entity payment that depends on entity loan
1) Draw a relational table for entity loan .
2) What is the primary key for your table laon?
3) Draw a relational table for weak entity payment.
4) What is the primary key for your table payment?
5) 要不要建一個 Table for weak relationship “loan-payment”, why?
Wei-Pang Yang, IM.NDHU, 2010
Introduction to Database System
2011 Final Test-5
Question 5: E-R Model  Tables


(10%)
在E-R Model 中Many-to-Many Relationship Set 須要造一個新Table
例如:
borrower
n
n
1) 解釋這一句敘述: “A many-to-many relationship set is represented
as a table with columns for the primary keys of the two participating
entity sets, and any descriptive attributes of the relationship set.”
2)
One-to-One Relationship Set 要建新 Table嗎? 為什麼?
Wei-Pang Yang, IM.NDHU, 2010
Introduction to Database System
6-6
Question 6: 1NF  2NF
FIRST
S#
S1
S1
S1
S1
S1
S1
S2
S2
S3
S4
S4
S4
STATUS
20
20
20
20
20
20
10
10
10
20
20
20
(10%)
SECOND
CITY
London
London
London
London
London
London
Paris
Paris
Paris
London
London
London
P#
P1
P2
P3
P4
P5
P6
P1
P2
P2
P2
P4
P5
QTY
300
200
400
200
100
100
300
400
200
200
300
400
從下面幾點討論把 FIRST 拆成 SECOND 及 SP 的好處:
1)
Update? S1 moves from London to Paris
2)
Insertion: (S5 30 Athens)
3)
Delete "S3 supplies P2 200",
Wei-Pang Yang, IM.NDHU, 2010
Introduction to Database System
S# STATUS CITY
S1
S2
S3
S4
S5
20
10
10
20
30
London
Paris
Paris
London
Athens
SP
S#
P#
QTY)
S1
S1
S1
S1
S1
S2
S2
S3
S4
S4
P1
P2
P3
P4
P5
P1
P2
P2
P4
P5
300
200
400
200
100
300
400
200
300
400
2011 Final Test-7
Question 7: 2NF  3NF
CS (in 3NF)
SECOND (in 2NF)
CITY
S# STATUS CITY
S1
S2
S3
S4
S5
20
10
10
20
30
Athens
London
Paris
Rome
London
Paris
Paris
London
Athens
1)
SECOND 還有缺點嗎?
2)
SECOND是3NF嗎? Why?
(10%)
SC (in 3NF)
STATUS
30
20
10
50
S#
S1
S2
S3
S4
S5
CITY
London
Paris
Paris
London
Athens
從下面幾點討論把 SECOND拆成 CS及 SC 的好處
3)
Update
4)
Insertion
5)
Delete
Wei-Pang Yang, IM.NDHU, 2010
Introduction to Database System
2011 Final Test-8
Question 8: Indexing


(10%)
Consider the Supplier table, S.
假設 Index 整個放在一個 page, S Table 每一筆 tuple 各放一個 page
City-Index (index)
S (indexed file)
Athens
S1
Smith
20
London
London
S2
Jones
10
Paris
London
S3
Blake
30
Paris
Paris
S4
Clark
20
London
Paris
S5
Adams
30 Athens
1)
要列印所有住在 “Athens” 的Supplier’s Name, 需多少Disk I/O? 解釋之。
2)
要列印所有住在 “London” 的Supplier’s Name, 需多少Disk I/O? 解釋之。
3)
要列印所有住在 “Taipei” 的Supplier’s Name, 需多少Disk I/O? 解釋之。
4)
若插入 “S6 Yang 25 Hualien”, 重畫 S 及 City-Index 二 Tables.
5)
如果沒有City-Index, 要列印所有住在 “London” 的Supplier’s Name, 需多少Disk
I/O? 解釋之。
Wei-Pang Yang, IM.NDHU, 2010
Introduction to Database System
2011 Final Test-9
Question 9: B+-tree
50
(10%)
82
index set
12
32
58
70
89
94
6
8 12
15 18 32
35 40 50
51 52 58
60 62 70
71 78 82
83 85 89
91 93 94
96 97 99
1)
何謂 direct access?
Sequence set
2)
B+ tree 如何提供 “fast direct access” 的服務?
3)
如果要找 key= “62”, 何謂 sequential access?
(with pointers
to data records)
4)
B+ tree 如何提供 “fast sequential access” 的服務?
5)
若一個 node 可放 100 key 時,第三層共可放幾個 key?
Wei-Pang Yang, IM.NDHU, 2010
Introduction to Database System
2011 Final Test-10
Question 10: About Your Final Term Project

(10%)
According to your final project as “Design and implement a useful
database application system”
1) What is the title of your project?
2) Names of members in your team.
3) Draw the E-R Diagram of your application system. (You can just
give a similar diagram.)
4) Draw a table to show one relation used in the system
5) Check your answer in d) to see whether it is in the 1NF? Why?
Please answer “why” by using the definition of the 1NF.
6) Same as e) to see whether it is in the 2NF? Why?
7) Same as e) to see whether it is in the 3NF? Why?
Wei-Pang Yang, IM.NDHU, 2010
Introduction to Database System
2011 Final Test-11