Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Normalization in database 101
Brain Dump
Dec 9, 2024
40 views
As we read that data modeling is done for:
Normalisation is an essential part of database design that helps ensure that
It builds upon the conceptual & logical data models we've discussed
Does this question ring a bell?
We will consider the whole design as a single table & use some methods to obtain the optimal design.
This causes storage overhead, and inconsistency in data
Key Concepts of Normalization
If we have table
Here if we ant to add new employee in branch B005, then we need to add new tuples
Insertion anomaly:
Deletion Anomaly:
IF we want to remove staffNo, S25, we are also removing branch B007 and branch address i.e atlanta. We don't have any other copy of it.
Modification Anomaly:
Let's say we have 1 million data in this table and 400,000 record are connected with B001, and we move the location of the branch B001, then the branch address needs to be updated for 400,000 datas
What is Normalization?
The concept of functional dependency?
Position is functional dependent on staffNo.
When we know staff no, we can find the position of the that staff
What about is staffNo functionally dependent on position?
All non key attributes are functionally dependent on key attribute
How do we represent this functional dependency?
If we have the b attribute we can find the a attribute. This a attribute of R table is functional dependent on b table.
Ways to Normalization:
We start from unnormalised form UNF,
thus it is 1NF
here we can see
So this can be further normalised.
here :
Thus we need to split the table
Let's analyse these tables. We made it to 2nd normal form. But we still see two non key attribute are functional dependent. Risk is dependent to the State. If we know state we can find the Risk factor. S# determines state, state determines Risk
We will have delete and update anomaly.
How do we convert the 2NMF to 3NMF?
We need to break the table further & make sure no functional dependency exist between two non key attributes.