Download Informix Guide to SQL: Tutorial

Transcript
Chapter
Building Your Data Model
Why Build a Data Model . . . . . . . . .
Entity-Relationship Data-Model Overview .
.
.
.
.
.
.
.
.
.
.
8-3
8-4
Identifying and Defining Your Principal Data Objects . . . . . . .
Discovering Entities . . . . . . . . . . . . . . . . .
Choosing Possible Entities . . . . . . . . . . . . .
Pruning Your List of Entities . . . . . . . . . . . . .
The Telephone-Directory Example . . . . . . . . . . .
Diagramming Your Entities . . . . . . . . . . . . .
Defining the Relationships . . . . . . . . . . . . . . .
Connectivity . . . . . . . . . . . . . . . . . .
Existence Dependency . . . . . . . . . . . . . . .
Cardinality . . . . . . . . . . . . . . . . . . .
Discovering the Relationships . . . . . . . . . . . .
Diagramming Your Relationships . . . . . . . . . . .
Identifying Attributes . . . . . . . . . . . . . . . .
Selecting Attributes for Your Entities . . . . . . . . . .
Listing Your Attributes . . . . . . . . . . . . . . .
About Entity Occurrences . . . . . . . . . . . . . .
8-5
8-5
8-5
8-6
8-7
8-9
8-9
8-10
8-10
8-11
8-11
8-16
8-17
8-17
8-18
8-18
Diagramming Your Data Objects . . . . . . . . . . . . . .
Reading Entity-Relationship Diagrams . . . . . . . . .
The Telephone-Directory Example . . . . . . . . . . .
8-19
8-20
8-21
Translating E-R Data Objects into Relational Constructs .
Rules for Defining Tables, Rows, and Columns . . .
Placing Constraints on Columns . . . . . .
Determining Keys for Tables . . . . . . . . .
Primary Keys . . . . . . . . . . . . .
Foreign Keys (Join Columns) . . . . . . . .
Adding Keys to the Telephone-Directory Diagram
8-22
8-23
8-24
8-25
8-25
8-27
8-28
.
.
.
.
.
.
.
.
.
8
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.