You are on page 1of 7

Table in 1 Normal Form (Elimination of Repeating Groups)

StdSSN

STDClass

OfferNO

OffYear

Enrgrade

courseNo

crsdesc

2 Normal Form - Identify FDs by creating FDD & FD lists:

StdSSN StdCity

StdClass

OfferNo OffTerm OffYear CourseNo

FD Lists:
StdSSN StdCity, StdClass
OfferNo OffTerm, OffYear, CourseNo, CrsDesc
CourseNo CrsDesc
StdSSN, OfferNo EnrGrade

CrsDesc EnrGrade

2 NF violation rules: Every nonkey column depends on all candidate keys,


not a subset of any candidate key
FD Lists:
StdSSN StdCity, StdClass
OfferNo OffTerm, OffYear, CourseNo, CrsDesc
CourseNo CrsDesc
StdSSN, OfferNo EnrGrade
Tables in 2 NF
StdSSN StdCity, StdClass
OfferNo OffTerm, OffYear, CourseNo, CrsDesc
StdSSN, OfferNo EnrGrade

3NF rules: nonkey column identifies another nonkey column


CourseNo --- CrsDesc --- violation
Non key --- Non key column
OfferNo OffTerm, OffYear, CourseNo, CrsDesc
OfferNo OffTerm, OffYear, CourseNo (FK)
CourseNo -- CrsDesc
OfferNo OffTerm, OffYear, CourseNo (fk)
CourseNo CrsDesc
2.1 (OfferNo, OffTerm, OffYear, courseNo)

2.2 (CourseNo, CrsDesc)


Final list of tables:
Table 1 (StdSSN StdCity, StdClass)
Table 2 (OfferNo, OffTerm, OffYear, courseNo)
Table 3 (CourseNo, CrsDesc)
Table 4 StdSSN, OfferNo EnrGrade
Validation of normalized tables: -- inserts, deletes, updates
Table 1
StdSSN
001
001
002

StdCity
SSpring
SSPring
CPARK

StdClass
DBST651
DBST662 - INSERT ANOMALY
DBST651

Delete from student where stdssn =001 and stdclass =DBST651;


NO DELETE ANOMALY
UPDATE student set stdclass = DBST668 where stdssn =001 and
stdclass=DBST651;
001

SSpring

DBST668

NO UPDATE ANOMALY
Steps to normalization:
1. Check for anomalies --- if yes then normalization is needed.
2. Check if the table has repeating groups Yes --- violates 1 NF
3. Fix for 1NF violation: eliminating repeating groups meets 1 NF
4. Create FD diagram
5. Create FD lists

6. Check for 2 NF violation


7. Group the tables meeting 2 NF
8. Check for 3 NF violation
9. Group the table to meet 3 NF
10. Test the final tables to verify that there are no anomalies
11.
Final tables to satisfy 3 NF

You might also like