Chapter 6: Database Design Using Entity

Report
Database Processing
Chapter 6
Database Design Using
Entity-Relationship Models
David M. Kroenke
© 2000 Prentice Hall
Chapter 6
Entities & Relationships
“those things that users want to track”
“how entities relate to one another”
Page 144
© 2000 Prentice Hall
Representation of an Entity
Page 144
Figure 6-1
© 2000 Prentice Hall
Customer Entity in DK/NF
Page 145
Figure 6-2
© 2000 Prentice Hall
Normalized Entity
Page 146
Figures 6-3a and 6-3c
© 2000 Prentice Hall
Chapter 6
Has-A Relationships
• 1:1 or 1:N
• Foreign key
“when the key of one relation is stored
in a second relation”
Page 147
© 2000 Prentice Hall
1:1 Relationships
Page 148
Figure 6-6
© 2000 Prentice Hall
1:N Relationships
Page 149
Figure 6-8
© 2000 Prentice Hall
Chapter 6
1:N Relationship Terms
• Parent
“on the one side of the relationship”
• Child
“on the many side of the relationship
Page 149
© 2000 Prentice Hall
1:N Data Structure Diagram
Page 149
Figure 6-9
© 2000 Prentice Hall
N:M Relationships
Page 150
Figure 6-13
© 2000 Prentice Hall
Chapter 6
Other Relationships
• Recursive
“relationship among entities of the
same class”
• Ternary
• IS-A
Page 152
© 2000 Prentice Hall
E-R Diagram
Page 159
Figure 6-20a
© 2000 Prentice Hall
Relations for E-R Diagram
Page 159
Figure 6-20b
© 2000 Prentice Hall
Chapter 6
Patterns of Relationships
• Tree
• Simple Networks
• Bills of Materials
Page 160
© 2000 Prentice Hall
Chapter 6
Tree
“hierarchy; a data structure in which
the elements of the structure have
only one-to-many relationships with
one another”
Page 161
© 2000 Prentice Hall
Tree E-R diagram
Page 161
Figure 6-22
© 2000 Prentice Hall
Chapter 6
Simple Network
“data structure having only 1:N
relationships, but the elements may
have more than one parent as long as
the parents are of different types”
Page 161
© 2000 Prentice Hall
Simple Network E-R Diagram
Page 163
Figure 6-24
© 2000 Prentice Hall
Complex Network
“a data structure of elements in which at
least one of the relationships is N:M”
Page 162
Figure 6-25
© 2000 Prentice Hall
Bills of Materials
“a special data structure that occurs
frequently in manufacturing
applications”
Page 162
Figure 6-26
© 2000 Prentice Hall

похожие документы