DB Design5
DB Design5
Database Systems
Concepts, Languages and Architectures
Paolo Atzeni * Stefano Ceri . Stefano Paraboschi . Riccardo Torlone
.McCraw-HilU999
To view these slides on-screen or with a projector use the arrow keys to move to the next or
previous slide. The return or enter key will also take you to the next slide. Note you can press
the 'escape' key to reveal the menu bar and then use the standard Acrobat controls @
including the magnifying glass to zoom in on details.
To print these slides on acetates for projection use the escape key to reveal the menu and
choose 'print' from the 'tile' menu. If the slides are too large for your printer then select 'shrink
to tit' in the print dialogue box.
Database Systems
Chapters: Normalization
Functional dependencies
Employee---> Salary
the salary of each employee is unique and thus each time a certain
employee appears in a tuple, the value of his or her salary always remains
the same.
the budget of each project is unique and thus each time a certain project
appears in a tuple, the value of its budget always remains the same.
Database Systems
Chapter 8: Normalization
Non-trivial functional dependencies
Given a relation that does not satisfy Boyce-Codd normal form, we can
often replace it with one or more normalized relations using a process
called normalization.
The keys of the relations we obtain are the left hand side of a functional
dependency: the satisfaction of the Boyce-Codd normal form is therefore
guaranteed.
database Systems
chapters: Normalization
A relation to be decomposed
' Employee-Branch
Project-- Branch
Database Systems
Chapter8: Normalization
Employee Branch
Project Branch
Brown Chicago
Mars Chicago
Green Birmingham
Jupiter Birmingham
Hoskins Birmingham
Saturn Birmingham
Venus Birmingham
database Systems
chapter 8 : Normalization
The result is different from the original relation: the information can
not be reconstructed.
Database Systems
Chapters: Normalization
Lossless decomposition
The decomposition of a relation r on X1 and X2 is lossless if the join of the
projections of r on X1 and X2 is equal to r itself (that is, not containing
spurious tuples).
Employee Branch
Employee Project
Brown Chicago
Brown Mars
Green Birmingham
Green Jupiter
Hoskins Birmingham
Green Venus
Hoskins Saturn
Hoskins Venus
Database Systems
Chapters: Normalization
Assume we wish to insert a new tuple that specifies the participation of the
employee named Armstrong, who works in Birmingham, on the Mars project.
Preservation of dependencies
Qualities of decompositions
Decompositions should always satisfy the properties of lossless
decomposition and dependency preservation:
A problematic decomposition
The relation is not in Boyce-Codd normal form because the left hand side of
the first dependency is not a super key.
A relation r\s in third normal form if, for each (non-trivial) functional
dependency X- V defined on it, at least one of the following is
verified:
X contains a key K of r ,
each attribute in Y is contained in at least one key of r.
Database Systems
Chapter8: Normalization
Functional dependencies:
the analysis of the relations obtained during the logical design phase can
identify places where the conceptual design was inaccurate: this
verification of the design is often relatively easy; the ideas on which
normalization is based can also be used during the conceptual design
phase for the quality control of each element of the conceptual schema.
An entity to undergo a verification of normalization
Database Systems
Chapters: Normalization
The relationship THESIS is in third normal form, because its key is made up
of the STUDENT entity, and the only dependencies that exist on it are those
that have this entity as left hand side.
On the other hand, the properties described by the two dependencies are
independent of each other: not all students are writing theses and so not all of
them have supervisors.
From the normalization point of view, this situation does not present problems.
However , at the conceptual modelling level, we must distinguish among the
various concepts. We can therefore conclude that it would be appropriate to
decompose the relationship further, obtaining two relationships, one for each
of the two concepts.
The result of a further decomposition of a relationship
A relationship that is difficult to decompose
A restructuring of the previous schema
A relationship whose normalization is to be verified