Data Model

データベース工学
生研 戦略情報融合研究センタ
喜連川 優
Data Model
 Data
Model is a set of concepts that can be used
to describe the structure of database
 High
level data model
 ER-Model
 Entity
Relationship Model
 Entity: 実体、実世界のオブジェクト、概念
例
従業員、プロジェクト
 Attribute:
entity記述のためのproperty
 Relationship: entity 間の関係
Representational Data Model
 Implementation Data
 Relational
Model
 Hierarchical Model
 Network Model
 OO Model
 OR Model
Model
Physical Data Model
 Physical Storage Organization
 Access Methods
 Inverted
Index
 Clustering
Index
 Non-clustering Index
 Hash
based Index
 Multi – dimensional Index
 Extensible Index
データベースシステム設計
データベース設計
 1.インタビュー
 2.概念データベース設計
 実装の詳細は含めない
 素人との会話に利用
 3.商用DBMSを想定した実際のDB設計
 論理データベース設計
 4.物理データベース設計
 ファイル編成
ER-Model

Entity: 実体、物



Attribute: Entityの記述子


人、車、家:物理的に実在するもの
会社、仕事、大学の講義:概念的に存在
Employee: name, age,address, salary, job
Attributeの値


Simple vs.Composite(全体としても部分としても見る)
Single Valued vs. Multiple Valued


年、vs. 学位(2つ以上持ちうる)
Stored, vs. Derived
年齢は計算可能
 # of employee:数えれば算出可能

 Null
 Not
applicable
 学位を持っていない人
 Unknown
 Missing
身長不明
 Not known 電話があるかどうかも不明
Middle
First
Last
Name
SEX
SSN
Address
Salary
Professor
BirthDate
Age
アンダライン:キーを意味する。
Degree
Phones
マルチアトリビュート
記号
 Entity
 Attribute
 Multi-Attribute
 Relationship
Relationship
Degree of relationship type
 The number
of participating entity types
 Degree=2(previous example)
 Degree=3(next example)
Role Name
 同一Entityに 2つ以上のrelationshipが存在
する場合に区別.
Cardinality Ratio
 The number
of relationship instances that an
entity can participate in.
 1:1
 1:N
 N:M
例
work for DEPT:EMP = 1:N
1 : 1
1
1
N
M
Participation Constraints
 Total participation
 Partial participation
例
すべての社員はいずれかの部に属さ
ねばならない。
N
1
WORK_FOR
EMP
1
MANAGE
DEPT
1
Attribute for Relationship Type
 1:1
いづれのEntityにつけてもOK
 1:N N側のEntityにつけてもOK
 N:M Relationshipにつける
Hours
N
EMP
M
WORK_FOR
PROJECTS
Weak Entity Type
 Key Attribute を有さず、他のEntityとの関連
によってその存在が認識される。
 Identifying
Owner
 Identifying Relationship
 (Total Participation)
 Partial Key
ER ダイアグラムの書き方
 左から右へ文章として読めるように記載
 わかりやすい表記に工夫
3項関係 あるいは 2項関係の複合による表現