Chapter6 Normalization
Chapter6 Normalization
Example 1
CR56 A. S PG4 R no.602, 1-9-92 10-6-94 350 C040 T. M
Bl. 1006
Manama
Prop_rental_Owner_relation:
Cust_no Pr_no Paddr ReSt ReFi Rent O_No Oname
CR76 PG4 R no.602, Bl. 1-7-94 31-8-96 350 CO40 T. M
1006 Manama
CR76 PG16 R. no. 12 1-9-96 1-9-98 400 CO93 R. S
Bl. 203 Muharaq
CR56 PG4 R no.602, Bl. 1-9-92 10-6-94 350 C040 T. M
1006 Manama
CR56 PG36 R. no. 93 Bl. 333 10-10- 1-12-95 375 CO93 R. S
Manama 94
primary key
Conversion to Second Normal Form
Step 1: Write Each Key Component on a Separate Line
Write each key component on separate line, then write
original (composite) key on last line
Each component will become key in new table
Step 2: Assign Corresponding Dependent Attributes
Determine those attributes that are dependent on other
attributes
Conversion to Second Normal Form
Conversion to Second Normal Form
Conversion to Second Normal Form
Cust_no Pr_no Paddr ReSt ReFi Rent O_No Oname
Rental_relation
Cust_no Pr_no ReSt ReFi
CR76 PG4 1-7-94 31-8-96
CR76 PG16 1-9-96 1-9-98
Property_Owner_Relation
Pr_no Paddr Rent O_No Oname
PG4 R no.602, Bl. 350 CO40 T. M
1006 Manama
PG16 R. no. 12 400 CO93 R. S
Bl. 203 Muharaq
Third Normal Form (3NF)
Based on the concept of transitive dependency.
Transitive Dependency is a condition where
A, B and C are attributes of a relation such that if A B
and B C,
then C is transitively dependent on A through B.
(Provided that A is not functionally dependent on B or
C).
ABCD
CB
BCNF Example
ClientInterview
roomNo staffNo interviewTime interviewDate ClientNo
G101 SG5 10.30 13-May-02 CR76
For example, two tuples have to be updated if the roomNo need be changed for
staffNo SG5 on the 13-May-02.
Example of BCNF
To transform the ClientInterview relation to BCNF, we must remove
the violating functional dependency by creating two new relations
called Interview and StaffRoom as shown below,
StaffRoom
roomNo interviewDate staffNo
G101 13-May-02 SG5
G102 13-May-02 SG37
G102 1-Jul-02 SG5
{StudentID, ClassID}
Example 2 Cont…
The key for this table is the combination of
StudentID and ClassID. To avoid violation of
2NF, all other information about each student
and each class is stored in separate Student and
Class tables, respectively.
* *
Students Classes
* *
Classes Teachers
case 3:
Assume the following relation with multi-value
dependency:
Emplyee_Language(Eid:pk1, Languages:pk2)
Language Eid
English 100
Kurdish 100
Arabic 200
…Cont
Emplyee_Language(Eid:pk1, Skills:pk2)
Skill Eid
Teaching 100
Politic 100
Singing 200