Database Normalization: 1NF to 3NF Guide
Database Normalization: 1NF to 3NF Guide
May 2020.
Database Construction
Bogotá D.C.
First Part
What is normalization?
Es el proceso de organizar los datos de una base de datos. Se debe tener en cuenta la creación
of tables and the rules that are used to define the relationships, these rules are designed to
protect the data, and to make the database flexible in order to eliminate redundancies
For our database tables to be normalized, they must comply with the following rules:
to avoid redundancies and inconsistencies in the dependencies. These rules are known as
Normal form
Although other levels of normalization are possible, the third normal form is considered the
Example
Students
Tutor
Room
Classes 1, 2, and 3
By applying the first normal form, we eliminate the repeated groups, leaving us with only one.
class column and repeating the student, tutor, and room data and now we don't have
Unnormalized table
First Normal Form: Remove repeating groups
• Create independent tables for sets of values that apply to multiple records.
Example:
By moving to the second normal form, we will eliminate redundant data, and for this, we are going to
create two tables. One table will be called Students where we will eliminate redundant data
keeping only the unique data (Student, Tutor, and Room) and in a second table that
we will call Registration for the student number and the classes he will take in the example
student 1606 and 2602 will each take three classes. The content of the (1FN) First Form
A normal that was in one table has been divided into two tables to eliminate redundant data and
Students:
Record:
Records should not depend on anything other than the primary key of the table, including the key.
composed if necessary
Example:
To move to the third normal form, fields that do not depend on the key must be eliminated.
and to achieve this, we divided the student table into two tables and created the Faculty table where
we will move the room column that does not depend on the key which is the student column,
The tutor's name will be the link to the student table, although it could also be the column.
student.
Students:
Faculty:
Registration:
Database normalization is a very important point that we should take into account.
that in the future they do not present difficult database problems to solve.
Normalizing data ensures that information is organized and always kept in its place.
Data consistency
The reliability of the data is increased for all parties involved who access the databases, and there is
find duplicate data in different parts of the database taking into account the types of
The main advantage of normalizing data, apart from eliminating redundancies, is the design of
data integrity that clearly shows how information from different tables is related
between each other. This facilitates the identification of data relationships and corrects any isolation or
data management software system. With a good database organization, install this system.
es más rápido y sencillo, y podrá conectarse fácilmente a las fuentes de datos externas o internas
More security
more precise.
Cost savings
It is much easier to maintain the existing databases and make new improvements.
It is also faster to connect data sources to any internal or external system, as it does not
It will be necessary to carry out revisions to ensure that the data sent is correct.
to identify a record as unique, that is, in a table we can know which is a record in
specific only by knowing the primary key. In an entity-relationship architecture, the primary key
allows the relationships of the table that has the primary key, with other tables that will use it
Example:
Table: Invoices
Fields:
It is called a foreign key, it is one or more fields of a table that reference the field or
primary key fields from another table, a foreign key indicates how the tables are related.
The data in the foreign key and primary key fields must match, even though the names of
The foreign key is also determined at the time of the relationships between the tables in which
the primary key performs the join with the other field of another table and automatically becomes
a foreign key
Example:
Fields:
ID_InvoiceDetail (ID_InvoiceDetail is the primary key, unique and non-repeating for each
ID_Invoice (ID_Invoice is now our foreign key since it is the key by which we
Continuing with the project that provided a solution in activity 2 through the design of the diagram
entity relationship, at this stage of the course you must apply normalization up to the third normal form
1. Apply the first, second, and third normal forms (1NF, 2NF, 3NF) to the design.
The first normal form is applied in the Customers and Employees tables for the Names columns.
and Last Names, based on what was explained in the readings; we can define for each of the
Clients Table:
Tabla Empleados:
In order to maintain data integrity and ensure that no issues arise during queries
The second normal form is applied by creating a new table (Area) to be able to have a
control of the possible areas of work where the employee has a relationship; this is removed from the table
Cargo
Charge Table
A new table (Tipos_comision) is created to establish a one-to-one relationship with the Employee table.
in order to establish that an employee can only have one type of commission
Se crea una nueva tabla (Estado) para referenciar los posibles estados en los cuales están los
A new table (Tipos_credito) is created in order to establish a relationship between Branch and
Suppliers
A new table (Payment_Methods) is created in order to establish a relationship between Branch and
Client
A new table (Contacts) is created in order to manage the contacts associated with a supplier.
independently and thus visualize how many contacts there are per provider
3NF: Third Normal Form
For the case study, considering the application of the previous standardizations, we do not
PRIMARY KEY(Cod_area));
PRIMARY KEY(Cod_cargo));
PRIMARY KEY(Cod_cliente));
CREATE TABLE Contacts (
PRIMARY KEY(Cod_Contactos));
PRIMARY KEY(Cod_employee));
PRIMARY KEY(Cod_estado));
CREATE TABLE Payment_Method (
PRIMARY KEY(Cod_Metodo_pago),);
PRIMARY KEY(Order_number));
PRIMARY KEY(Cod_barras),);
PRIMARY KEY(Cod_provider));
PRIMARY KEY(Cod_sucursal));
PRIMARY KEY(Cod_Tipos_comision),);
PRIMARY KEY(Cod_Tipos_credito));
CREATE TABLE Identification_Type (
PRIMARY KEY(CodTipo_identificacion));
PRIMARY KEY(No_sale));
Reference List
[Link]
[Link]
[Link]