Module 2 Lecture
Module 2 Lecture
Ninth Edition
Chapter 2
The Relational Model
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Learning Objectives
2
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Relational Terms
3
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.1 Characteristics of a
4
Relation
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.2 Sample EMPLOYEE
5
Relation
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.3 Nonrelational Table-
6
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.4 Nonrelational Table-Order
7
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.5 Relation with Variable-
8
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Presenting Relation Structures
9
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.6 Equivalent Sets of Terms
10
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Types of Keys
11
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Example of a Relation
12
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.7 Defining a Primary Key in
13
MySQL 8.0
Oracle Database XE
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Foreign Keys
18
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Referential Integrity
19
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.11 Enforcing Referential
20
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.15 Sample ITEM Relation
25
and Data
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Functional Dependencies
26
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Normalization
27
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Normalization
28
Any table that meets the requirements of a relation, has a primary key,
and no repeating groups is in first normal form.
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Normalization
29
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Normalization
31
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Normalization
33
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Normalization
35
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Normalization
37
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Normalization Process
38
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.18 Normalized CUSTOMER
40
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.19 Sample STU_DORM
41
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.20 Normalized STU_DORM
42
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.21 Sample EMPLOYEE
43
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.22 Normalized EMPLYEE
44
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.23 Sample MEETING
45
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 2.24 Normalized MEETING and
46
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Eliminating Anomalies from
47
Multivalued Dependencies
Learn to apply a process for normalizing
relations
• When modification problems are due to functional
dependencies and we then normalize relations to BCNF, we
eliminate these anomalies.
• Anomalies can also arise from another kind of dependency—
the multivalued dependency.
– A multivalued dependency occurs when a determinant is
matched with a particular set of values as seen below.
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
48
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
The Normal Forms (1 of 2)
49
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
The Normal Forms (2 of 2)
50
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Copyright
51
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved