COMP 101 Lecture Notes - Lecture 14: Second Normal Form, Functional Dependency, Third Normal Form

106 views8 pages
21 Jun 2018
School
Department
Course
Professor
C
h
a
p
t
e
r
1
4
&
C
h
a
p
t
e
r
1
5
Normalization
Chapter 14 & 15 - Objectives
The purpose of normalization.
How normalization can be used when designing a relational database.
The potential problems associated with redundant data in base relations.
The concept of functional dependency, which describes the relationship between attributes.
The characteristics of functional dependencies used in normalization.
Chapter 14 - Objectives
How to identify functional dependencies for a given relation.
How functional dependencies identify the primary key for a relation.
How to undertake the process of normalization.
How normalization uses functional dependencies to group attributes into relations that are in a
known normal form.
Chapter 14 - Objectives
How to identify the most commonly used normal forms, namely First Normal Form (1NF), Second
Normal Form (2NF), Third Normal Form (3NF), Boyce–Codd normal form (or BCNF or 3.5NF), and
Forth Normal Form (4NF)
The problems associated with relations that break the rules of 1NF, 2NF, 3NF, BCNF, and 4NF
How to represent attributes shown on a form as 3NF relations using normalization.
Purpose of Normalization
Normalization is a technique for producing a set of suitable relations that support the data
requirements of an enterprise.
Purpose of Normalization
Characteristics of a suitable set of relations include:
the minimal number of attributes necessary to support the data requirements of the enterprise;
attributes with a close logical relationship are found in the same relation;
minimal redundancy with each attribute represented only once with the important exception of
attributes that form all or part of foreign keys.
Purpose of Normalization
The benefits of using a database that has a suitable set of relations is that the database will be:
a
s
i
f
o
t
h
u
s
t
o
a
s
s
a
n
d
m
a
i
n
t
a
i
n
t
h
d
a
t
a
;
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 8 pages and 3 million more documents.

Already have an account? Log in
D
a
t
a
R
e
d
u
n
d
a
n
c
y
a
n
d
U
p
d
a
t
e
A
n
o
m
a
l
i
e
Problems associated with data redundancy are illustrated by comparing the Staff and Branch
relations with the StaffBranch relation.
Data Redundancy and Update Anomalies
Data Redundancy and Update Anomalies
StaffBranch relation has redundant data; the details of a branch are repeated for every member of
staff.
In contrast, the branch information appears only once for each branch in the Branch relation and
only the branch number (branchNo) is repeated in the Staff relation, to represent where each
member of staff is located.
Data Redundancy and Update Anomalies
Relations that contain redundant information may potentially suffer from update anomalies.
Types of update anomalies include
Insertion
Deletion
Modification
Lossless-join and Dependency Preservation Properties (M)
Two important properties of decomposition.
Lossless-join property enables us to find any instance of the original relation from corresponding
instances in the smaller relations.
Dependency preservation property enables us to enforce a constraint on the original relation by
enforcing some constraint on each of the smaller relations.
The Process of Normalization
As normalization proceeds, the relations become progressively more restricted (stronger) in format
and also less vulnerable to update anomalies.
The Process of Normalization
The Process of Normalization
Unnormalized Form (UNF)
A table that contains one or more repeating groups.
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 8 pages and 3 million more documents.

Already have an account? Log in
U
N
F
t
o
1
N
F
Remove the repeating group by
Entering appropriate data into the empty columns of rows containing the repeating data
(‘flattening’ the table).
Or by
Placing the repeating data along with a copy of the original key attribute(s) into a separate
relation.
Example
Example
Functional Dependencies
Important concept associated with normalization.
Functional dependency describes relationship between attributes.
For example, if A and B are attributes of relation R, B is functionally dependent on A (denoted A
B), if each value of A in R is associated with exactly one value of B in R.
Practical interpretation: an occurrence in A determines an occurrence in B without ambiguity.
Characteristics of Functional Dependencies
Property of the meaning or semantics of the attributes in a relation.
Diagrammatic representation.
The determinant of a functional dependency refers to the attribute or group of attributes on the left-
hand side of the arrow.
An Example Functional Dependency
Example Functional Dependency that holds for all Time
Consider the values shown in staffNo and sName attributes of the Staff relation (see Slide 12).
Based on sample data, the following functional dependencies appear to hold.
staffNo → sName
sName → staffNo
Example Functional Dependency that holds for all Time
However, the only functional dependency that remains true for all possible values for the staffNo
and sName attributes of the Staff relation is:
t
a
f
f
N
o
N
a
m
e
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 8 pages and 3 million more documents.

Already have an account? Log in

Document Summary

How normalization can be used when designing a relational database. The potential problems associated with redundant data in base relations. The concept of functional dependency, which describes the relationship between attributes. The characteristics of functional dependencies used in normalization. How to identify functional dependencies for a given relation. How functional dependencies identify the primary key for a relation. How to undertake the process of normalization. How normalization uses functional dependencies to group attributes into relations that are in a known normal form. How to identify the most commonly used normal forms, namely first normal form (1nf), second. Normal form (2nf), third normal form (3nf), boyce codd normal form (or bcnf or 3. 5nf), and. The problems associated with relations that break the rules of 1nf, 2nf, 3nf, bcnf, and 4nf. How to represent attributes shown on a form as 3nf relations using normalization.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents