Professional Documents
Culture Documents
The process of producing a simpler and more reliable database structure or relations is called normalization. It is used
to create a suitable set of relation for storing data. This process works through different stages known as normal forms. These
stages are INF, 2NF, 3NF, BCNF, 4NF and 5NF.
The purpose of normalization is to remove anomalies from the data. Each normal form has certain requirements or
condition. These conditions have to fulfill to bring the database in that particular normal form. If a relation satisfies the
conditions of a normal form, it is said to be in that normal form.
Anomalies.
Anomalies are undesirable properties or problems in relation that exist due to data redundancy in relation.
Anomalies affect the process of inserting, deleting and modifying data in relations.
Types of anomalies.
Insertion Anomaly.
Insertion anomaly occurs when a new record is inserted in the relation. In this anomaly, the user cannot insert a fact
about an entity until he has an additional fact about another entity.
Deletion Anomaly.
Deletion anomaly occurs when a record is deleted from the relation. In this anomaly, the deletion of facts about an
entity automatically deletes the fact of another entity.
Modification Anomaly.
The modification anomaly occurs when the record is updated in the relation. In this anomaly, the modification in the
value of specific attribute requires modification in all records in which that value occurs.
A relation is in first normal form 1NF if it does not contain a repeating group. A repeating group is a set of one or
more data items that may occur a variable number of times in a cell. The value in each cell should be atomic that is each cell in a
table should contain only one value.
Teacher Table
A relation is in second normal form 2NF if it is in INF and if all its non key attributes are fully functionally dependent
on the whole primary key. If any non key attribute is not functionally dependent on whole primary key or only dependent on a
portion of primary then it is partial functional dependency. In 2NF we have to remove partial functional dependency from the
table to achieve full functional dependency. For example, Marks is fully dependent on Student_ID and Subject_ID.
A relation is in third normal form if it is in 2NF and if no non-key attribute is dependent on another non-key attribute.
That is there should not be any transitive dependency. Transitive dependency occurs when a non-key attribute depends on
another non-key attribute instead of depending on the primary key. Or in other words transitive dependency occurs when a
non-key attribute which depends on primary key determines another non-key attribute.
Subject_ID Teacher_ID
Transitive Dependency.
001 Naveed
002 Adila
003 Mughal
004 Salman
005 Zeeshan
179 SE 5
203 NA 6
111 DBA 1
3 179 SE 3 Pointing 22 33 GUJ Ibraham
Practice # 2:
179 TAX 5
203 AUDIT 6
204 CONSULTING 1
3 111 System 3 Zahid 22 33 GUJ Zeeshan
Practice # 3:
005 Umer
008 Imran
003 Iqra
1 Masood
2 Khalida
3 Javed
1 002 Ali
1 005 Umer
1 008 Imran
2 001 Asif
2 003 Iqra
3 004 Anum
Practice # 5:
Practice # 6:
Country
State
City
Practice # 7:
Student
Subject
Teacher
NOTE: A subject is only taught by one teacher but a teacher can teach many subject. A student can read only one
subject but one subject can be read by many students.
Country_ID Country_NAME
1 Pakistan
2 India
3 America
Subject_ID Subject_NAME
1 DBA
2 ENGLISH
3 MATH
Teacher_ID Teacher_NAME
1 ZEESHAN
2 ADILA
3 NAVEED
Subject_Teacher Table
Teacher_FID Subject_FID
1 1
1 2
1 3
2 1
2 3
3 2