Database Normalization
Database Normalization
Here you see the Movies Rented column has multiple values.
Now let’s move into 1st Normal Forms:
We have divided our 1NF table into two tables viz. Table 1 and
Table2. Table 1 contains member information. Table 2 contains
information on movies rented.
We have introduced a new column called Membership_id which is
the primary key for table 1. Records can be uniquely identified in
Table 1 using membership id
You will only be able to insert values into your foreign key that exist
in the unique key in the parent table. This helps in referential
integrity.
The above problem can be overcome by declaring membership id
from Table2 as foreign key of membership id from Table1
Now, if somebody tries to insert a value in the membership id field
that does not exist in the parent table, an error will be shown!
What are transitive functional
dependencies?
A transitive functional dependency is when changing a non-key
column, might cause any of the other non-key columns to change
Consider the table 1. Changing the non-key column Full Name may
change Salutation.
We have again 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
Now our little example is at a level that cannot further be
decomposed to attain higher normal form types of normalization 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. However, we will be discussing next
levels of normalisation in DBMS in brief in the following.