Download - Unit0555555
![Page 1: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/1.jpg)
Chapter 5The Relational Model and
Normalization
David M. Kroenke
Database Processing
© 2000 Prentice Hall
![Page 2: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/2.jpg)
Chapter 5
© 2000 Prentice Hall
The Relational Model
• Broad, flexible model• Basis for almost all DBMS products• E.F. Codd defined well-structured
“normal forms” of relations, “normalization”
Page 113
![Page 3: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/3.jpg)
Chapter 5
© 2000 Prentice Hall
Relation
• Two-dimensional table• Rows are tuples• Columns are attributes
Page 113
![Page 4: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/4.jpg)
Equivalent Relational Terms
Page 114Figure 5-1 © 2000 Prentice Hall
![Page 5: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/5.jpg)
Functional Dependency“relationship between or among
attributes”
Page 114Figure 5-2 © 2000 Prentice Hall
![Page 6: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/6.jpg)
Chapter 5
© 2000 Prentice Hall
Functional Dependency Notation
SID MajorComputerSerialNumber
MemorySize
(SID, ClassName) Grade
Page 115
![Page 7: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/7.jpg)
Key“a group of one or more attributes
that uniquely identifies a row”
Page 116Figure 5-3 © 2000 Prentice Hall
![Page 8: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/8.jpg)
Combination Key
Page 117Figure 5-4 © 2000 Prentice Hall
![Page 9: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/9.jpg)
Chapter 5
© 2000 Prentice Hall
Normalization
“the process of evaluating and converting a relation to reduce modification anomalies”
Page 118
![Page 10: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/10.jpg)
Chapter 5
© 2000 Prentice Hall
Anomaly
“an undesirable consequence of data modification in which two or more different themes are entered (insertion anomaly) in a single row or two or more themes are lost if the row is deleted (deletion anomaly)”
Page 118
![Page 11: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/11.jpg)
Chapter 5
© 2000 Prentice Hall
Normal Forms
“classes of relations and techniques for preventing anomalies”
DK/NF = Domain Key Normal Form(free of modification anomalies)
Page 118
![Page 12: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/12.jpg)
First Normal Form“any table of data that meets the
definition of a relation”
Figure 5-3 © 2000 Prentice Hall
![Page 13: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/13.jpg)
Second Normal Form“when all of a relation’s nonkey attributes
are dependent on all of the key”
Figure 5-5 © 2000 Prentice Hall
![Page 14: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/14.jpg)
Third Normal Form“if it is in second normal form and
has no transitive dependencies”
Figure 5-7 © 2000 Prentice Hall
![Page 15: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/15.jpg)
Boyce-Codd Normal Form
“if every determinant is a candidate key”
Figure 5-8 © 2000 Prentice Hall
![Page 16: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/16.jpg)
Fourth Normal Form“if in BCNF and has no multi-value
dependencies”
Figure 5-11 © 2000 Prentice Hall
![Page 17: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/17.jpg)
Chapter 5
© 2000 Prentice Hall
Fifth Normal Form
? Page 125
![Page 18: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/18.jpg)
Chapter 5
© 2000 Prentice Hall
Domain Key Normal Form
“if every constraint on the relation is a logical consequence of the definition of keys and domains”
Page 125
![Page 19: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/19.jpg)
Chapter 5
© 2000 Prentice Hall
DK/NF Terms
• Constraint “a rule governing static values of attributes”
• Key “unique identifier of a tuple”• Domain “description of an
attribute’s allowed values”
Page 126
![Page 20: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/20.jpg)
DK/NF Example
Figure 5-13 © 2000 Prentice Hall
![Page 21: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/21.jpg)
DK/NF Example
Figure 5-15 © 2000 Prentice Hall
![Page 22: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/22.jpg)
DK/NF Example
Figure 5-16 © 2000 Prentice Hall
![Page 23: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/23.jpg)
Summary of Normal Forms
Figure 5-18 © 2000 Prentice Hall
![Page 24: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/24.jpg)
Chapter 5
© 2000 Prentice Hall
A B relationships
A B and B A one-to-oneA B but B not A many-to-oneA not B and B not A many-to-many
Page 131
![Page 25: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/25.jpg)
Summary of Relationships
Figure 5-19 © 2000 Prentice Hall
![Page 26: Unit0555555](https://reader033.vdocuments.site/reader033/viewer/2022061210/548ee353b47959a13a8b46d5/html5/thumbnails/26.jpg)
Chapter 5
© 2000 Prentice Hall
Optimization
• De-Normalization• Controlled Redundancy
Page 135