Professional Documents
Culture Documents
Normalization Notes
Normalization Notes
Normalization Notes
Functional Dependency
Armstrong's Axioms
Page 1 of 14
COMPILED BY: SANDIP GHOSHAL
NORMALIZATION (Normal Form)
Page 2 of 14
COMPILED BY: SANDIP GHOSHAL
Normalization
If a database design is not perfect, it may contain anomalies, which are like
a bad dream for any database administrator. Managing a database with
anomalies is next to impossible.
▪ Update anomalies
▪ Deletion anomalies
▪ Insert anomalies
First Normal Form is defined in the definition of relations tables itself. This
rule defines that all the attributes in a relation must have atomic domains.
The values in an atomic domain are indivisible units.
UNF → 1NF:
Before we learn about the second normal form, we need to understand the
following –
Page 3 of 14
COMPILED BY: SANDIP GHOSHAL
If we follow second normal form, then every non-prime attribute should be
fully functionally dependent on prime key attribute. That is, if X → A holds,
then there should not be any proper subset Y of X, for which Y → A also
holds true.
1NF → 2NF:
2NF → 3NF:
Page 4 of 14
COMPILED BY: SANDIP GHOSHAL
Transformation to BCNF:
In this case, these two columns can be called as multi valued dependent on
BIKE_MODEL. The representation of these dependencies is shown below:
BIKE_MODEL → → MANUF_YEAR
BIKE_MODEL → → COLOR
Page 5 of 14
COMPILED BY: SANDIP GHOSHAL
Fourth normal form (4NF):
Join Dependency
Page 6 of 14
COMPILED BY: SANDIP GHOSHAL
A spurious tuple is, basically, a record in a database that gets created
when two tables are joined badly. In database-ese, spurious tuples
are created when two tables are joined on attributes that are neither
primary keys nor foreign keys.
Temporal database
• Valid time is the time period during which a fact is true in the real
world. It consists of VST [Valid Start Time] & VET [Valid End Time].
• Transaction time is the time period during which a fact stored in the
database was known. It consists of TST [Transaction Start Time] &
TET [Transaction End Time].
• Decision time is the time period during which a fact stored in the
database was decided to be valid.
Uni-Temporal
A uni-temporal database has one axis of time, either the validity range or
the system time range.
Page 7 of 14
COMPILED BY: SANDIP GHOSHAL
Bi-Temporal
Tri-Temporal
• valid time.
• transaction time
• decision time.
Page 8 of 14
COMPILED BY: SANDIP GHOSHAL
Example: -
TABLE1
{ROLLNO, DEPT_NO, HOD, DEPT_NAME, S_NAME, STATUS, SUB, SECTION}
FDs =>
TABLE2
{ROLLNO, DEPT_NO, HOD, DEPT_NAME, S_NAME, STATUS, SECTION}
TABLE3
{ROLLNO, DEPT_NO, HOD, SUB}
TABLE3
{ROLLNO, DEPT_NO, HOD, SUB}
TABLE4
{ROLLNO, DEPT_NO, HOD, S_NAME, SECTION}
TABLE5
{ DEPT_NO, HOD, DEPT_NAME, STATUS}
Page 9 of 14
COMPILED BY: SANDIP GHOSHAL
3NF => Remove TRANSITIVE DEPENDENCY.
TABLE3
{ROLLNO, DEPT_NO, HOD, SUB}
TABLE5
{ DEPT_NO, HOD, DEPT_NAME, STATUS}
TABLE6
{ROLLNO, DEPT_NO, HOD, S_NAME}
TABLE7
{S_NAME, SECTION}
TABLE3
{ROLLNO, DEPT_NO, HOD, SUB}
TABLE6
{ROLLNO, DEPT_NO, HOD, S_NAME}
TABLE7
{S_NAME, SECTION}
TABLE8
{ DEPT_NO, HOD, STATUS}
TABLE9
{DEPT_NAME, HOD}
Page 10 of 14
COMPILED BY: SANDIP GHOSHAL
TABLE1 ------------------------------------------------- UNF
TABLE1
FDs =>
{ROLLNO } → →{SUBJECT}
{ROLLNO } → → {MARKS} --------------------- MVD
{SUBJECT } → → {MARKS}
[Assuming NAME is atomic]
Page 11 of 14
COMPILED BY: SANDIP GHOSHAL
4NF => Separate SVD & MVD.
During normalizing into 5NF if any one decomposes TABLE3 into TABLE4
& TABLE5 [As those two tables cover all the attributes of TABLE3] only then that will be
a bad decomposition or wrong normalization which may cause a problem of
spurious touple.
After joining TABLE4 & TABLE5 we get following set of data which is not
same as TABLE3.
TABLE4 TABLE5
But if we join TABLE4, TABLE5 & TABLE6 then, we get same data as
TABLE3.
Page 13 of 14
COMPILED BY: SANDIP GHOSHAL
Example of DK/NF
TABLE1
{ROLLNO, NAME, FEES_PAID, SECTION}
FDs =>
TABLE2
{ROLLNO, NAME}
TABLE3
{ROLLNO, FEES_PAID, SECTION}
TABLE1