Presentation is loading. Please wait.

Presentation is loading. Please wait.

中央大學。范錚強 1 資料模式 Data Modeling 國立中央大學 資訊管理系 范錚強 2001.11.

Similar presentations


Presentation on theme: "中央大學。范錚強 1 資料模式 Data Modeling 國立中央大學 資訊管理系 范錚強 2001.11."— Presentation transcript:

1 中央大學。范錚強 1 資料模式 Data Modeling 國立中央大學 資訊管理系 范錚強 2001.11

2 中央大學。范錚強 2 大綱  資料模式基本觀念  實體關係模型  資料模型和流程模型的整合  資料模型、邏輯資料庫設計、實體資料 庫設計

3 中央大學。范錚強 3 基本觀念:資料流、實物流  現有的表單、記錄等,都只是資料的載具 資料流 實物流

4 中央大學。范錚強 4 資料:結構、處理  模型  用抽象的方式來代替具體的事物  資料:結構、處理  資料模型  蔡倫的文明:表單、記錄  資訊文明:資料庫  問題:如何將具象用資料庫來表現

5 中央大學。范錚強 5 系統分析: 資料觀、流程觀、狀態觀  流程觀:  Document Flow, Data Flow  因處理的流程而變  狀態觀  Program Flow Chart, State Transition  特定功能的細節  資料觀  表現真實世界中的事物、事件--比較穩定  Semantics Data Modeling  以資料觀為主的分析,比較穩定,且具前瞻性

6 中央大學。范錚強 6 基本的實體關係模型 (E-R modeling)  陳品山 Peter Chen 提出  設計得好的模型,保證 3NF  Entity :實體  物體、觀念、事件  Relationship :關係  關係  Attributes :屬性  實體或關係的性質

7 中央大學。范錚強 7 基本的實體關係模型 (E-R modeling)2  Typing :類型  Instances  Types  Entity type  用長方形來表示  Attribute  用小圓圈來表示  通常省略 Employee ID# NameSex Birth Date

8 中央大學。范錚強 8 Relationship Type 關係類  代表兩實體類的關係  以菱形表示  顯示法很多  連接性 Connectivity and Cardinality  Connectivity  connectivity between the instances in the connecting entity types  1 to 1, 1 to many, many to many  Cardinality  the actual number associated with the connectivity  e.g.: a 1-m relationship can be (0,1)-(0,5)

9 中央大學。范錚強 9 進階觀念  複合性關係  關係和屬性  實體群組  最後,將所有實體和關係的屬性列出

10 中央大學。范錚強 10 資料模型和流程模型的整合  修訂模式  修改 DFD 中的 data store ,消除所有「迷糊帳」  所有 data store 相對到相關的實體或關係  建立資料典 DD:Data Dictionary  平衡 Balancing 原則  Every data flow and data store must be defined in the DD, Vice Versa  Every data store must correspond to an entity or relationship type  Object names in the DD, ERD and DFD must match  DD entries must apply to both the DFD and ERD model

11 中央大學。范錚強 11 資料模型、邏輯資料庫設計、實 體資料庫設計  Process  E-R data model --> Logical database design --> physical database design  ANSI SPARC three tier DB architecture  Enterprise views  User views  Physical views Physical Enterprise user

12 中央大學。范錚強 12 充實、調整資料模型  Attributing and Refining  Attributing all entity and relationship types  Eliminate all multi-valued attributes with appropriate relationships  Identify an identifying attributes for each entity type and and any compound relationship

13 中央大學。范錚強 13 設計關連式資料庫 Logical Schema  For each entity type:  Each Entity type becomes a Table  Every attribute becomes a column  The identifying attribute for the entity type becomes the key for the Table  For each m-n relationship type  Each m-n relationship type becomes a Table  Every attribute becomes a column  The identifying attribute of the associated entity types becomes the compound keys

14 中央大學。范錚強 14 關連式資料庫 Logical Schema (2)  For each 1-n relationship type  Same as m-n relationship  Only the n-side identifier becomes the key, the 1-side identifier becomes a non-key column  For each 1-1 relationship type  Same as 1-n relationship  Pick the identifier from the appropriate associated entity type as the key, the other a non-key column

15 中央大學。范錚強 15 關連式資料庫 Logical Schema (3)  For each compound entity type  For the compound entity types that do not have its own identifier, same as relationship  Otherwise, use the identifier as the key, and take the identifying attribute of the associated entity types as non-key columns

16 中央大學。范錚強 16 其他限制  在 Compound Entity 中﹐若有任何相關的 entity type 的 identifier 必須相同﹐將相關的 key 去除  若有其他的限制﹐加入到 DBMS 中﹐資料的 integrity 或 referential constraints 中

17 中央大學。范錚強 17 實體資料庫設計  可考慮將單一欄位的 Table 取消  Referential constraints  Domain specification  深入了解 data behavior  合併或分解 Tables  Examine the properties and behavior of tables and data  Combine tables with the same key or same partial keys as appropriate (may result in lower normal forms)  Split a Table into multiple tables, to maximize operational efficiency


Download ppt "中央大學。范錚強 1 資料模式 Data Modeling 國立中央大學 資訊管理系 范錚強 2001.11."

Similar presentations


Ads by Google