Professional Documents
Culture Documents
Normalisation is the process of analysing how to make databases more efficient by using separate tables
to reduce redundant data. When a database is normalised, data is broken down into smaller tables and
relationships are used to link them.
Connecting entities
When working with relational databases, users need to try to keep information about different entities
in separate tables. Each entity has a primary key to provide a unique reference to an entity, which means
that an entity can be referenced in another table without having to call up all the details about that entity.
You can represent these relationships using an entity relationship diagram (ERD).
One to one
One to many
Many to many
Relationship example
The following example shows how tables can be connected using primary and foreign keys.
The tables are in a database for an online shop. There are three tables:
customer
product
orders
Each table has a primary key field and each record has a primary key with a unique number.
Customer table
The customer table gives customers a unique Customer ID (the primary key for this table) and shows
customer details, i.e. name, address and phone number.
Product table
The product table gives details about the products. The Product ID is the primary key for this table.
Orders table
In the orders table, each order has a unique Order number (the primary key for this table). The table also
includes customer ID (the primary key of the customer table) and product ID (the primary key of the
product table) as foreign keys, but does not need to include all details about customers and products as
these are stored in the Customer and Product tables.
Normalisation
If the Orders table did not use Customer ID and Product ID fields, it would need to include additional
fields from the Customer table and the Product table – an extra eight fields. It would also need to repeat
the same customer details for each order. The Orders table would be much larger, use more data, and be
repetitive.
Normalising the data creates a selection of simpler tables which takes up less data.