Database Techniques DB Normalization
Database Techniques DB Normalization
Database Normalization
What is Normalization?
• Rule 1- Be in 2NF
• Rule 2- Has no transitive functional
dependencies
• To move our 2NF table into 3NF, we need to
divide our table again.
3NF Example
• Below is a 3NF example in SQL database:
In above illustration, We divided our
tables and created a new table which
stores Salutations.
There are no transitive functional
dependencies, and hence our table is in
3NF
In Table 3 Salutation ID is primary key,
and in Table 1 Salutation ID is foreign to
primary key in Table 3
Our example at a level that cannot further
be decomposed to attain higher normal
form in DBMS. In fact, it is already in higher
normalization forms.
Separate efforts for moving into next levels
of normalizing data are normally needed in
complex databases.
Let discuss next levels in brief as follows:
• BCNF (Boyce-Codd Normal Form) also referred
to as 3.5 Normal Form
•Even when a database is in 3rd Normal
Form, still there would be anomalies if it
has more than one Candidate Key.
a table.
• 4NF (Fourth Normal Form) Rules
• If no table contains two or more, independent and
multivalued data describing the relevant entity, then
it is in 4th Normal Form.
• 5NF (Fifth Normal Form) Rules
• A table is in 5th Normal Form only if it is in 4NF
and it cannot be decomposed into any
number of smaller tables without loss of data.
• 6NF (Sixth Normal Form) Proposed
• 6th Normal Form is not standardized, it is being
discussed by database experts. Hopefully, we
would have a clear & standardized definition
for 6th Normal Form in the near future…
Denormalization
• Is a strategy used on a previously normalized
database to increase performance.
• Is the process of trying to improve the read (select)
performance of a database, at the expense of losing
some write (insert) performance, by adding redundant
copies of data.
• It is motivated by performance or scalability in
relational database when very large numbers of read
operations is necessary
Denormalization differs
from unnormalized form.
It benefits can only be
fully realized on a data
model that is already
normalized.
Implementation
A normalized design will often store different
but related information in separate logical tables
(called relations).
If these relations are stored as separate files,
completing a database query that draws
information from several relations (a join
operation such as: Left joint, right joint, inner joint or
outer joint)can be slow.
If many relations are joined, it may be too slow.
There are two strategies for dealing with this.
DBMS support