Library Normalization Example
Library Normalization Example
The following exercise is an attempt to assert the knowledge of standardization with a simplified example of a
database for a small library.
This table does not meet the First Normal Form (1FN) requirement of having only atomic fields, since the
reader's name is a field that can (and should) be broken down into paternal surname, maternal surname and first
names.
1NF
CodLibro Title Author Editorial Paterno Materna Names DateDev
l
Complex McGraw
1001 Murray Spiegel Perez Gomez John 15/04/2005
variable Hill
1004 Visual Basic 5 E. Petroustsos Anaya Rivers Teran Ana 17/04/2005
McGraw
1005 Statistics Murray Spiegel Rock René 16/04/2005
Hill
Oracle Nancy Oracle
1006 Garcia Roque Luis 20/04/2005
University Greenberg Corp.
Oracle Oracle
1006 Priya Nathan Garcia Roque Luis 20/04/2005
University Corp.
McGraw
1007 Clipper 5.01 Ramalho Perez Gomez John 18/04/2005
Hill
Currently in our table we have several partial dependencies if we consider as key attribute the book code.
For example, the title is completely identified by the book code, but the name of the reader does not really
depend on this code, so this data must be moved to another table.
2FN
The new table will only contain data from the reader.
We created a table to contain the reader data and also had to create the CodLector column to uniquely identify
each reader.
However, this new database layout necessitates that there be another table to maintain the information of which
books are loaned to which readers.
For the Third Normal Form (3FN) the relationship must be in 2FN and in addition the non-key attributes must be
mutually independent and completely dependent on the primary key.
Recall also that we said that this means that the columns in the table must contain only information about the
entity defined by the primary key and, therefore, the columns in the table must contain data about only one thing.
In our 2FN example, the first table holds information about the book, authors and publishers, so we must create
new tables to satisfy 3FN requirements.
3FN
CodLibro Title
1001 Complex variable
1004 Visual Basic 5
1005 Statistics
1006 Oracle University
1007 Clipper 5.01
CodAutor Author
801 Murray Spiegel
802 E. Petroustsos
Nancy
803 Greenberg
804 Priya Nathan
806 Ramalho
CodEditorial Editorial
901 McGraw Hill
902 Anaya
903 Oracle Corp.
Although we have created new tables so that each one has only information about one entity, we have also lost
the information about which author has written which book and the corresponding publishers, so we must create
other tables that relate each book to its authors and publishers.
CodLibro codAutho
r
1001 801
1004 802
1005 801
1006 803
1006 804
1007 806
CodLibro codEditorial
1001 901
1004 902
1005 901
1006 903
1007 901
And the rest of the tables do not need modification.