Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 2012 Final Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account.

Similar presentations


Presentation on theme: "Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 2012 Final Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account."— Presentation transcript:

1 Introduction to Database System Wei-Pang Yang, IM.NDHU, Final Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account 存款帳 3. depositor 存款戶 6. loan 貸款帳 4. borrower 貸款戶 分公司 國立東華大學試題 : 資料庫管理 資訊管理學系

2 Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 1: Terms Explanation (20%) 1)Logical Database Design 2)Update Anomalies 3)Minimize the number of Disk Access 4)Weak Entity 5)Draw the Functional Dependency Diagram for table account in page 1. 6)Total participator vs. Partial participator in ER-Model 7)Many-to-Many Relationship Set 8)blob: binary large object 9)foreign key (branch-name) references branch on delete cascade 10)Generalization vs. Specialization 2012 Final Test-2

3 Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 2: Real-world vs. E-R Model vs. Tables (10%) 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 3. depositor 存款戶 分公司 Semantic Data Model: Entity-Relationship (E-R) Data Model The real-world enterprise 試討論 Real-world, E-R Model, 及 Tables 之關係 2012 Final Test-3

4 Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 3: 1NF  2NF (10%) S# STATUS CITY S1 20 London S2 10 Paris S3 10 Paris S4 20 London S5 30 Athens SECOND S# P# QTY) S1 P1 300 S1 P2 200 S1 P3 400 S1 P4 200 S1 P5 100 S2 P1 300 S2 P2 400 S3 P2 200 S4 P4 300 S4 P5 400 SP S # STATUS CITY P# QTY S1 20 London P1 300 S1 20 London P2 200 S1 20 London P3 400 S1 20 London P4 200 S1 20 London P5 100 S1 20 London P6 100 S2 10 Paris P1 300 S2 10 Paris P2 400 S3 10 Paris P2 200 S4 20 London P2 200 S4 20 London P4 300 S4 20 London P5 400 FIRST 從下面幾點討論把 FIRST 拆成 SECOND 及 SP 的好處 : 1)Update? S1 moves from London to Paris 2)Insertion: (S5 30 Athens) 3)Delete "S3 supplies P2 200", 2012 Final Test-4

5 Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 4: 2NF  3NF (10%) S# STATUS CITY S1 20 London S2 10 Paris S3 10 Paris S4 20 London S5 30 Athens SECOND (in 2NF) 1)SECOND 還有缺點嗎 ? 2)SECOND 是 3NF 嗎 ? Why? 從下面幾點討論把 SECOND 拆成 CS 及 SC 的好處 3)Update 4)Insertion 5)Delete CITY STATUS Athens 30 London 20 Paris 10 Rome 50 CS (in 3NF) SC (in 3NF) S# CITY S1 London S2 Paris S3 Paris S4 London S5 Athens 2012 Final Test-5

6 Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Consider the Supplier table, S. 假設 Index 整個放在一個 page, S Table 每一筆 tuple 各放一個 page S1 S2 S3 S4 S5 Smith Jones Blake Clark Adams London Paris London Athens City-Index (index) Athens London Paris S (indexed file) Question 5: Indexing (10%) 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? 解釋之。 2012 Final Test-6

7 Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 6: B + -tree (10%) index set Sequence set (with pointers to data records) - 1)B+ tree 如何提供 “fast direct access” 的服務 ? 以找 key= “62” 為例說明 2)B+ tree 如何提供 “fast sequential access” 的服務 ? 3) 若一個 node 可放 100 key 時,第三層共可放幾個 key? 4)Sequence set (with pointers to data records) 是什麼意思 ? 2012 Final Test-7

8 Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 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? Question 7: About Your Final Term Project (10%) 2012 Final Test-8

9 Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Host Language + DSL Host Language + DSL Host Language + DSL Host Language + DSL Host Language + DSL User A1User A2User B1User B2User B3 External # & External View B External/conceptual mapping A Conceptual View External/conceptual mapping B Conceptual/internal mapping Stored database (Internal View) Database management system dictionary (DBMS) e.g. system catalog < DBA Storage structure definition (Internal schema ) Conceptual schema External schema A External schema B (Build and maintain schemas and mappings) & DSL (Data Sub Language) C, Pascal e.g. SQL Question 8: 儘量解釋右圖 (10%) 第 8 、 9 、 10 任選二題做答 2012 Final Test-9

10 Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Major System Components: DB2 Source Module Modified Source Module DBRM Object Module Load Module Application Plan PL/I-Compiler Bind Pre-compiler Linkage Editor (Load Module) (Application Plan) Runtime Supervisor Data Manager Buffer Manager (Other) DB PL/I + SQL: EXEC SQL CREATE TABLE S ( S# CHAR(5),......) EXEC SQL SELECT SNAME INTO :SNAME FROM S IF SQLCODE < 0 THEN CALL CREATE(......) CALL SELECT(......) IF SQLCODE < 0 THEN PL/I source parse-tree version of SQL request module a DB Compiler optimized machine codes of SQL statements in system Catalog ' 4 1st time 1. Pre-compiled 2. Bind 3. Runtime Supervisor 4. Data Manager 5. Buffer Manager Question 9: 儘量解釋下圖 (10%) 第 8 、 9 、 10 任選二題做答 2012 Final Test-10

11 Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 DB2’s Major System Components: Execution time Runtime Supervisor Application Plan ( for P ) Stored Data Manager If - - CALL - Catalog or Dictionary "data about data" Database "data" Buffer Manager PL / 1 LOAD MODULE P Question 10: 儘量解釋下圖 (10%) 第 8 、 9 、 10 任選二題做答 2012 Final Test-11


Download ppt "Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 2012 Final Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account."

Similar presentations


Ads by Google