Analysis and Design of Data Systems. Functional Dependencies and Normalization Theory (Lecture 15)

Слайд 2

Functional Dependency The abbreviation for functional dependency is FD or f.d.

Functional Dependency

 

 

 

 

The abbreviation for functional dependency is FD or f.d.

Слайд 3

Example

Example

Слайд 4

Functional Dependency (meaning) A functional dependency is a property of the

Functional Dependency (meaning)

A functional dependency is a property of the semantics

or meaning of the attributes.

The database designers will use their understanding of the semantics (meaning) of the attributes of R—that is, how they relate to one another—to specify the functional dependencies that should hold on all relation states of R.

The main use of functional dependencies is to describe further a relation schema R by specifying constraints on its attributes that must hold at all times.

Слайд 5

FD is a property of a Relation A functional dependency is

FD is a property of a Relation

A functional dependency is a

property of the relation schema R, not of a particular instance of R. Therefore, an FD must be defined explicitly by someone who knows the semantics of the attributes of R

One cannot determine which FDs hold and which do not unless the meaning of and the relationships among the attributes are clearly known and understood

Слайд 6

FD is a property of a Relation A functional dependency is

FD is a property of a Relation

A functional dependency is a

property of the relation schema R, not of a particular instance of R. Therefore, an FD must be defined explicitly by someone who knows the semantics of the attributes of R

One cannot determine which FDs hold and which do not unless the meaning of and the relationships among the attributes are clearly known and understood

Слайд 7

Other Properties of FDs

Other Properties of FDs

 

 

 

Слайд 8

Normal Forms based of PK’s Motivation Normalization can be considered a

Normal Forms based of PK’s

Motivation

Normalization can be considered a process of

analyzing the given relation schemas based on their FDs and primary keys to achieve the desirable properties of :
minimizing redundancy and
minimizing the insertion, deletion, and update anomalies

In other words Normalization is a process to make the design have successively better quality.

If relations doesn’t meet certain conditions (normal form tests) they are decomposed into ‘smaller’ relations schemas that meet the tests hence possess desirable properties.

Слайд 9

FD is a generalization of a Key If a relation schema

FD is a generalization of a Key

 

 

 

If a relation schema has

more than one key, each is called a candidate key

One of the candidate keys is arbitrarily designated to be the
primary key, and the others are called secondary keys

Let’s

An attribute of R is called a prime attribute if it is a member of some candidate key of R. An attribute is called nonprime if it is not prime.

Слайд 10

First Normal Form (1NF) The domain of an attribute must include

First Normal Form (1NF)

The domain of an attribute must include only

atomic (simple, indivisible) values and that the value of any attribute in a tuple must be a single value from the domain of that attribute.
Слайд 11

Second Normal Form (2NF) - Full dependency - Partial dependency

Second Normal Form (2NF)

 

- Full dependency

- Partial dependency

Слайд 12

Second Normal Form (2NF) The test for 2NF involves testing for

Second Normal Form (2NF)

 

The test for 2NF involves testing for functional

dependencies whose left-hand side attributes are part of the primary key.
If the primary key contains a single attribute, the test need not be applied at all.

Nonprime attributes Ename, Pname, and Plocation violate 2NF.

Слайд 13

Second Normal Form (2NF)

Second Normal Form (2NF)

Слайд 14

Third Normal Form (3NF) A relation schema R is in 3NF

Third Normal Form (3NF)

 

 

A relation schema R is in 3NF if

it satisfies 2NF and no nonprime attribute of R is transitively dependent on the primary key.