Presentation is loading. Please wait.

Presentation is loading. Please wait.

從 ER 到 Logical Schema ──兼談Schema Integration

Similar presentations


Presentation on theme: "從 ER 到 Logical Schema ──兼談Schema Integration"— Presentation transcript:

1 從 ER 到 Logical Schema ──兼談Schema Integration
國立中央大學 資訊管理系 范錚強 updated 中央大學。范錚強

2 準備Logical Schema 資料模型和流程模型的整合 充實、調整資料模型 設計關連式資料庫 Logical Schema
中央大學。范錚強

3 資料模型和流程模型的整合 修訂模式 平衡Balancing原則 修改DFD中的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 中央大學。范錚強

4 充實、調整資料模型 Attributing and Refining
Attributing all entity and relationship types Each attribute should associate with the corresponding entity or relationship type The value of the attribute should solely depends (fully functionally dependent, FDD) on the associated element in the entity or relationship type Identify an identifying attributes for each entity type and and any compound entity type If there are many candidates, pick one that is the most appropriate. 中央大學。范錚強

5 充實、調整資料模型(2) Eliminate all multi-valued attributes with appropriate relationships Attribute the new E/R types Name n Name m Company Company 中央大學。范錚強

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

7 設計關連式資料庫 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 The identifying attribute of the associated entity types becomes the compound keys 中央大學。范錚強

8 關連式資料庫 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 (foreign key) column For each 1-1 relationship type Same as 1-n relationship Pick the identifier from the most appropriate associated entity type as the key, the other a foreign key 中央大學。范錚強

9 關連式資料庫 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 (foreign key) columns Annotate the foreign key “references” in the DD of the DBMS To preserve referential constraints 中央大學。范錚強

10 ABA’D ABD? OR AB AD A B A D 中央大學。范錚強

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

12 深入了解data behavior Examine the properties and behavior of tables and data Behavior? Access requirements for tables and attributes Access frequency Natural clusters in data processing Optimize systems performance based on data behavior 中央大學。范錚強

13 實體資料庫設計 單一資料庫 合併或分解Tables 可考慮將單一欄位的Table取消,但注意
Referential constraints Domain specification 合併或分解Tables 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 中央大學。范錚強

14 分散式資料庫 決定分散的政策 Full replication (複製) Partitioning (分割) 中央大學。范錚強

15 根據表單進行分析 系統分析的其中一個方法,是根據各種企業中運作時,產生和使用的表單 表單──反映了: 逐個分析成為一個 sub-schema
交易、活動 權狀 統計分析 中央大學。范錚強

16 交易/活動類型的表單 表頭、表身、表尾 通常,很多「屬性」都會是其他部分的 “entity + relationship” 組合
表頭:交易/活動屬性、和其他實體的關連 表身:細目、分項活動 表尾:細目總計、反映交易/活動屬性 通常,很多「屬性」都會是其他部分的 “entity + relationship” 組合 中央大學。范錚強

17 發票 這是什麼? 表頭 表身 表尾 中央大學。范錚強

18 出貨單 表頭 表身 表尾 中央大學。范錚強

19 帳單 表頭 表身 表尾 中央大學。范錚強

20 權狀 記名權狀 無記名權狀 代表一個所有權人對一個「權利」的擁有 需要至少有兩個實體和一個關係 一個實體或複合實體 土地、房屋所有權狀
飛機票 無記名權狀 一個實體或複合實體 火車票 電影院門票 中央大學。范錚強

21 統計分析 統計資料有很多為多維的表單 這些維度,通常都反映某些多維度的「關係」的屬性,經由「折疊」產生 例如:產品的銷售成績 產品、產品類別
零售通路、地區 業務員、部門 日、周、月、季、年 中央大學。范錚強

22 Schema Integration1 將各個Entity Type加以檢視,消除各個 sub-schema中
同一個意義,但使用不同名詞 不同意義,但使用相同名詞 相同的 Entity Type 為兩個 sub-schema之間的介接 訂單裡的供應商編號供應商彙整表中的供應商 POS 發票裡的櫃臺員編號薪水單中的員工 中央大學。范錚強

23 Schema Integration2 檢視相同Entity Type之間的 Relationship Type
同一個意義,但使用不同名詞 不同意義,但使用相同名詞 將連接性不同的 R, 彙整成為一個,或採用不同名稱 例如:圖書館中的出納角度:書和讀者為一對多 歷史紀錄角度:書和讀者為多對多(對多) 檢視Attribute, 有必要時將之改為 E/R 組合 有些 sub-schema 中的 attribute,為其他 sub-schema 中的 Entity/Relationship Types 重複將新的 Entity Types 和其他 sub-schema加以整合 中央大學。范錚強

24 其他 sub-schema 應用 在B2B E-business中,牽涉到電腦之間的資料交換 Data Interchange
過去,主要是 UN/EDIFACT 的 proprietary 系統之間的交換 Internet 環境之下,重點在 XML-based 的資料交換, e.g. ebXML, Rosettanet 資料交換重點: Process: 電腦間資料交換的程序標準 Message:電腦之間資料的規格,為一種 sub-schema 中央大學。范錚強

25 B2B 資料交換 自行到網路上查詢 RosettaNet, HL7 等資料 中央大學。范錚強


Download ppt "從 ER 到 Logical Schema ──兼談Schema Integration"

Similar presentations


Ads by Google