Database Normalization Exercise Guide
Database Normalization Exercise Guide
Exercise Guide
Apply the normalization rules to the following exercises.
1. A non-normalized data does not comply with any normalization rule. To explain with an example in what
consiste cada una de las reglas, vamos a considerar los datos de la siguiente tabla.
Orders
Id_orden Date Id_cliente Nom_cliente Estado Num_art nom_art cannot Price
2301 23/02/11 101 Martin Caracas 3786 Red 3 35.00
2301 23/02/11 101 Martin Caracas 4011 Racket 6 65.00
2301 23/02/11 101 Martin Caracas 9132 Paq-3 8 4.75
2302 25/02/11 107 Herman Chorus 5794 Paq-6 4 5,00
2303 27/02/11 110 Peter Maracay 4011 Racket 2 65.00
2303 27/02/11 110 Pedro Maracay 3141 Fund 2 10,00
The records are now structured into two tables that we will call ORDERS and
ORDER_ITEMS
Orders
Order_id Fecha Id_cliente Nom_cliente State
2301 23/02/11 101 Martin Caracas
2302 25/02/11 107 Herman Chorus
2303 February 27, 2011
110 Pedro Maracay
Order Articles
Id_orden Num_art nom_art can't Price
2301 3786 Red 3 35.00
2301 4011 Racket 6 65.00
2301 9132 Paq-3 8 4.75
2302 5794 Paq-6 4 5.00
2303 4011 Racket 2 65.00
2303 3141 Foundation 2 10.00
The ORDERS table is in 2NF. Any unique value of ID_ORDER determines only one value.
for each column. Therefore, all columns are dependent on the primary key
ORDER_ID.
For its part, the ARTICULOS_ORDENES table is not in 2NF because the columns
PRICE and NOM_ART are dependent on NUM_ART, but they are not dependent on
ORDER_ID. What we will do next is remove these columns from the table.
ARTICLES_ORDERS and create a TABLE ARTICLES with those columns and the primary key
on which they depend.
Order Articles
Id_orden Num_art can't
2301 3786 3
2301 4011 6
2301 9132 8
2302 5794 4
2303 4011 2
2303 3141 2
Articles
Num_art nom_art Price
3786 Red 35.00
4011 Racket 65.00
9132 Paq-3 4.75
5794 Paq-6 5.00
3141 Fund 10.00
Create a second table with those columns and with the non-key column of which they are
dependents.
Upon observing the tables we have created, we realize that both the ARTICLES table and
The ARTICULOS_ORDENES table is in 3NF. However, the ORDENES table is not.
is, since NOM_CLIENTE and ESTADO are dependent on ID_CLIENTE, and this column is not
the primary key.
To normalize this table, we will move the non-key columns and the key column from which
dependent within a new CLIENTS table. The new CLIENTS and ORDERS tables are
show below.
Orders
Id_orden Date Id_cliente
2301 23/02/11 101
2302 25/02/11 107
2303 27/02/11 110
Orders
Id_cliente Nom_cliente State
101 Martin Caracas
107 Herman Chorus
110 Peter Maracay
2. INVOICE OF PURCHASE SALE: The company COLOMBIAN SYSTEMS has hired you as the
"Project Manager" for systematizing billing. In the following PURCHASE SALE INVOICE,
you must analyze all the available information and apply the normalization process until you reach the
Third Normal Form.
A detailed justification of each of the steps leading to the result is requested.
final.
Where:
3. GOODS SHIPPING COMPANY: below are grouped all the attributes that are part of
from the database to apply normalization rules. Where the names of the
atributos con su significado
4. Video club: In a video store, it is necessary to keep information about around 3000 booths, each one
The tapes are assigned a number for each movie, and it is necessary to know a title and category for it.
example: comedy, suspense, drama, action, science fiction, etc. Some copies of many are kept.
movies. Each movie is assigned an identification and tracking is kept on what it contains.
cassettes.
A cassette can come in various formats and a movie is recorded on a single cassette; frequently the
Movies are requested according to a specific actor. Tom Cruise and Demi Moore are the most popular.
For this reason, information about the actors who belong to each movie must be maintained.
Not all movies feature famous actors; store customers like to know facts such as the
nombre real del actor, y su fecha de nacimiento.
The store only keeps information about the actors who appear in the movies and that is available.
disposition. Videos are only rented to those who belong to the video club. To belong to the club you
must have good credit. For each club member, a record is kept with their name, phone number and
address, each club member is assigned a membership number. It is desired to maintain information
Of all the tapes that a customer rents, when a customer rents a tape, the name should be known.
from the movie, the date it is rented and the return date.
It is requested to apply the normalization rules up to the third normal form, having the following entities.
with their respective attributes:
Where:
5. Given the following relationship LOAN_BOOKS (School, teacher, subject_skill, classroom, course,
book, publisher, loan_date) that contains information related to the loans made by the
editorials to primary school teachers for their evaluation in some of the
subjects/skills they teach. It is requested to apply normalization rules and obtain its model
relational, indicate its keys, main attributes.
Subject/
School Professor Classroom Course Book Editorial Loan date
skill
Learn and
Thought teach in
C.P Cervantes John Pérez 1.A01 1st Grade Grazing 09/09/2010
Logical education
childish
Preschool Techniques
C.P. Cervantes Juan Pérez Writing 1.A01 1st Grade 05/05/2010
Rubio, N56 Rubio
Learn and
Thought Teach in
C.P Cervantes Juan Pérez A01 1st Grade Grao 05/05/2010
Numeric education
childish
Thought
Alicia Spatial, Education Prentice
C.P Cervantes 1.B01 1st Grade 06/05/2010
García Temporal and Infant N9 Hall
causal
Learn and
Alicia Thought teach in
C.P Cervantes 1.B01 1st Grade Grao 06/05/2010
García Numeric education
childish
Learn and
Andrés teach in
C.P Cervantes Writing 1.A01 2nd Grade Graó 09/09/2010
Fernández education
childish
to know
educate: guide
Andrés Themes of
C.P Cervantes English 1.A01 2nd Grade for Parents 05/05/2010
Fernández Today
y
Teachers
To know
educate: guide
Juan Thought Themes of
C.P Quevedo 2.B01 1st Grade for Parents 18/12/2010
Méndez Logical Today
y
Teachers
Learn and
Juan Thought to teach in
C.P Quevedo 2.B01 1st Grade Grao 06/05/2010
Méndez Numeric education
childish
It is requested, considering only the extent of the relationship shown in the table:
a. Indicate an example of modification anomaly
b. Indicate an example of a deletion anomaly
[Link] SHIFTS: Given the following relationship ASSIGNMENT (DNI, Name, Store_Code,
Dirección_Tienda, Fecha, Turno) que contiene información relativa a la asignación de los turnos de trabajo
of the employees of the different centers of a fashion retail chain:
It is requested, considering only the extent of the relationship shown in the table:
a. Indicate an example of a deletion anomaly
b. Indicate the functional dependencies using the following abbreviations: ID (P), Name
(N), Código_Tienda (C), Dirección_Tienda (D), Turno (T), Fecha (F).
c. What Normal Form is the relationship in? What are its keys?
11. SPORTS ACTIVITIES: Given the following relationship, IT IS CARRIED OUT (Activity_Code,
Nombre_Actividad, DNI_Monitor, Nombre_monitor, Sala, Fecha, Hora_I, Hora_F) utilizada para
store information about the date and duration of the sports activities that are organized in
a school is requested:
It is requested, considering that the names of the monitors are not unique and the names of the activities
neither and adhering to the tuples of the relationship IS CARRIED OUT: