190 likes | 435 Views
NORMALISATION. Normal Forms: 1NF 2NF 3NF BCNF 4NF 5NF DKNF (only theoretical). 1 NF. A relation is said to be in 1nf if it has atomic values. MODIFICATION ANOMALIES. ACTIVITY (sid,activity,fee) key:sid INSERTION ANOMALIES DELETION ANOMALIES. FUNCTIONAL DEPENDENCIES.
E N D
NORMALISATION • Normal Forms: • 1NF • 2NF • 3NF • BCNF • 4NF • 5NF • DKNF (only theoretical)
1 NF • A relation is said to be in 1nf if it has atomic values.
MODIFICATION ANOMALIES • ACTIVITY (sid,activity,fee) • key:sid • INSERTION ANOMALIES • DELETION • ANOMALIES
FUNCTIONAL DEPENDENCIES • BLOCK-NAMERENT • Determinant Sid (Block,Room) ACTIVITY Fee X (Y,Z) XY and XZ (X,Y)Z / XZ or YZ
ACTIVITIES • KEY : (SID, Activity) • FDs : Activity Fee A Relation with a Two-Attribute key (in 1NF but not in 2NF)
2NF • 1NF+ All non-key attributes are dependeb\nt on all of the key . Decomposition ACTIVITIES[SID,ACTIVITY] Act-Fee[Activity,Fee]
A RELATION WITH TRANSITIVE DEPENDENCY • Key : SID • FDs : BuildingFee SIDBuildingFee
Stu - hostel key : SID Bldg-Fee Key : Building ELIMINATION OF TRANSITIVE DEPENDENCY
Relation in 3NF • ADVISOR • Key :( primary ) : (SID,Major) • Key :(Candidate) : (SID,Fname) • Functional Dependencies : FnameMajor
Stu -Adv ($id, Fname) Key :SID Adv-sub Key : Fname Fname Major Relations in BCNF
Relation with multivalued dependencies STUDENT • KEY(sid,major,activity) • multivalued sidmajor dependencies sid activity
stu-major key:sid,major stu-act Key:sid,activiy Elimination of MVDS
Relation in 4nf • STUDENT • KEY:sid • FDS:sidshoe-size; sidmariatal-status • MVDS: sid shoe-size/ mariatal-status • 4nf if MVDS are implied by candidate keys of R
5NF • Every JD in R is implid by candidate keys of R. SPJ:
SP: join over p# PJ: join over p#