Uploaded by wil

Database-Normalization

advertisement
Database
Normalization
1NF - 2NF - 3NF - BCNF
What is Database Normalization
Database Normalization was proposed by Edgar F. Codd as an integral part his
relational model.
It is a process of restructuring a relational database by applying rules to data, which
transforms the data into a certain structure, called a normal form.
The overall aim of normalization is to reduce data redundancy and improve data
integrity.
The normalization process is one of re-creating and/or improving a DB design. It
entails organizing columns and relations between tables of a DB.
Why do we Normalize a Database
➔ Reduce data redundancy, where there are multiple copies of the same
information spread over multiple locations in the same database. This
can create data anomalies:
◆ “INSERT” - same data from being stored in more than one place;
◆ “UPDATE” - updates being made to some data but not others;
◆ “DELETE” - data not being deleted or data being lost in the DB.
➔ Improve data integrity using integrity constraints that restrict the types of
data being entered into a table is accurate and reliable.
➔ Make the database more efficient
➔ Reduce the storage space that a database takes up
➔ Ensure the queries on a database run as fast as possible
What are Data Anomalies
An anomaly is where there is an issue in the data that is not meant to be there. This can
happen if a database is not normalised.
An INSERT anomaly happens when we try to insert a record into this table without knowing all
the data we need to know. We would be adding incomplete data to our table, which can cause
issues when trying to analyse this data.
An UPDATE anomaly happens when we want to update data, and we update some of the data
but not other data. Ideally, we would only update the value once, in one location.
A DELETE anomaly occurs when we want to delete data from the table, but we end up deleting
more than what we intended. We should be able to delete one type of data or one record
without having impacts on other records we don’t want to delete.
Download