Database Design Slides
Database Design Slides
a collection of entities,
8.2
2.
3.
4.
8.3
relation.
8.4
A simplified
COMPANY
relational
database
schema.
8.5
Sample database
state for some of
the COMPANY
relational database
Database System Concepts - 6th Edition
8.6
Example:
8.7
8.8
8.9
8.10
8.11
8.12
8.13
8.14
Functional Dependencies
A set of attributes X functionally determines a set of
key
8.15
8.16
Normalization
Normalization: The process of decomposing
to achieve:
Minimizing redundancy.
8.17
candidate key.
One of the candidate keys is designated to be the
candidate key.
A Nonprime attribute is not a prime attributethat is,
8.18
(simple) value.
8.19
8.20
8.21
8.22
8.23
3.
8.24
functional dependency.
8.25
8.26
8.27
transitive dependency.
8.28
8.29
8.30
8.31
Dependencies: Definitions
Multivalued Attributes: non-key attributes
8.32
Dependencies: Definitions
Partial Dependency: when an non-key
8.33
Dependencies: Definitions
Transitive Dependency: when a non-key
8.34
What is Normalization
Normalization allows us to organize data so that it:
8.35
groups.
2 NF 1 NF plus no partial dependencies
8.36
Example 1: Determine NF
Comp_ID and No are not
determined by the primary
key; therefore, the relation is
NOT in 1 NF. No sense in
looking at partial or transitive
dependencies.
Part_ID Description
Part_ID Price
Part_ID, Comp_ID No
PART
Part_ID
Descr
Price
8.37
Comp_ID
No
Example 1: Determine NF
In your solution you will write
the following :
There are M/V attributes; so,
not 1NF
Conclusion: The relation is not
normalized.
Part_ID Description
Part_ID Price
Part_ID, Comp_ID No
PART
Part_ID
Descr
Price
8.38
Comp_ID
No
Example 2: Determine NF
Product_ID Description
ORDER
Order_No
Product_ID
8.39
Description
Example 2: Determine NF
Product_ID Description
ORDER
Order_No
Database System Concepts - 6th Edition
Product_ID
8.40
Description
Silberschatz, Korth and Sudarshan
Example 2: Determine NF
Product_ID Description
ORDER
Order_No
Product_ID
8.41
Description
Example 2: Determine NF
Product_ID
Description
In your solution you will write the following:
1) No M/V attributes, therefore at least 1NF
2) There is a partial dependency
(Product_ID Description), therefore
not in 2NF
Conclusion: The relation is in 1NF
ORDER
Order_No
Database System Concepts - 6th Edition
Product_ID
8.42
Description
Silberschatz, Korth and Sudarshan
Example 3: Determine NF
All attributes are directly or
indirectly determined by
the primary key.
Relation is at least in 1 NF
ISBN Title
ISBN Publisher
Publisher Address
BOOK
ISBN
Title
Publisher
8.43
Address
Example 3: Determine NF
ISBN Title
ISBN Publisher
Publisher Address
BOOK
ISBN
Title
Publisher
8.44
Address
Example 3: Determine NF
ISBN Title
ISBN Publisher
Publisher Address
BOOK
ISBN
Title
Publisher
8.45
Address
Example 3: Determine NF
We know that the relation is
at least in 2NF, and it is not
in 3 NF. Therefore, we
conclude that the relation is
in 2NF.
ISBN Title
ISBN Publisher
Publisher Address
BOOK
ISBN
Title
Publisher
8.46
Address
ISBN Title
ISBN Publisher
Publisher Address
BOOK
ISBN
Title
Publisher
8.47
Address
STUDENT
Stud_ID
Name
Course_ID
Units
101
Lennon
MSI 250
3.00
101
Lennon
MSI 415
3.00
125
Johnson
MSI 331
3.00
8.48
Composite
Primary Key
STUDENT
Stud_ID
Name
Course_ID
Units
101
Lennon
MSI 250
3.00
101
Lennon
MSI 415
3.00
125
Johnson
MSI 331
3.00
8.49
relation.
Stud_ID
Name
Course_ID
Units
101
Lennon
MSI 250
3.00
101
Lennon
MSI 415
3.00
125
Johnson
MSI 331
3.00
8.50
Name
101
Lennon
125
Jonson
STUDENT_COURSE
Stud_ID
Course
Units
101
MSI 250
101
MSI 415
125
MSI 331
8.51
Composite
Primary Key
STUDENT
Stud_ID
Name
Course_ID
Units
101
Lennon
MSI 250
3.00
101
Lennon
MSI 415
3.00
125
Johnson
MSI 331
3.00
8.52
Partial Dependencies
STUDENT
Stud_ID
Name
Course_ID
Units
101
Lennon
MSI 250
3.00
101
Lennon
MSI 415
3.00
125
Johnson
MSI 331
3.00
8.53
Name
Course_ID
Units
101
Lennon
MSI 250
3.00
101
Lennon
MSI 415
3.00
125
Johnson
MSI 331
3.00
8.54
STUDENT
Stud_ID
Name
Course_ID
Units
101
Lennon
MSI 250
3.00
101
Lennon
MSI 415
3.00
125
Johnson
MSI 331
3.00
STUDENT
Stud_ID
Course_ID
101
MSI 250
101
MSI 415
125
MSI 331
COURSE
Stud_ID
Name
Course_ID
Units
101
Lennon
MSI 250
3.00
101
Lennon
MSI 415
3.00
125
Johnson
MSI 331
3.00
8.55
Transitive
Dependency
EMPLOYEE
Emp_ID
F_Name
L_Name
111
Mary
Jones
Acct
122
Sarah
Smith
Mktg
8.56
Dept_ID Dept_Name
EMPLOYEE
Emp_ID
F_Name
L_Name
111
Mary
Jones
Acct
122
Sarah
Smith
Mktg
8.57
Dept_ID Dept_Name
F_Name
L_Name
Dept_ID Dept_Name
111
Mary
Jones
Acct
122
Sarah
Smith
Mktg
EMPLOYEE
Emp_ID
F_Name
L_Name
Dept_ID
111
Mary
Jones
122
Sarah
Smith
DEPARTMENT
Dept_ID Dept_Name
8.58
Acct
Mktg
Silberschatz, Korth and Sudarshan
8.59