Beruflich Dokumente
Kultur Dokumente
Outline
n-decomposability 3D constraint join dependency 5NF non-5NF - update anomalies problems in bringing a relation to 5NF other normal forms
2
n-decomposable relations
Programming M. Ursu
CT
CL Programming Level2
5
CTL - 3-decomposable
the join of any two projections is not CTL; e.g:
join(CT, TL)
Course Databases Databases Databases Tutor M. Ursu M. Ursu M. Marman Level Level3 Level2 Level2 Level3 Level2
Extra!
Constraint 3D
Let R be a degree 3 relation. IF (a, b, x) R AND (a, y, c) R AND (z, b, c) R THEN (a, b, c) R
Join dependency
Let R be a relation. Let A, B, ..., Z be arbitrary subsets of Rs attributes. R satisfies the JD ( A, B, ..., Z ) if and only if R is equal to the join of its projections on A, B, ..., Z
10
5 NF
R is in 5NF if and only if every join dependency in R is implied by the candidate keys of R
5NF is always achievable
11
Explanation
a join dependency, (A, B, , Z), is implied by the candidate keys, K1, , Km of R if the fact that K1, , Km are candidate keys for R determine the fact that R has the JD (A, B, , Z)
12
({S_id, S_name, Status}, {S_id, City}) is a JD because S_id is a candidate key in R ({S_id, S_name}, {S_id, Status}, {S_name, City}) is a JD because S_id and S_name are both candidate keys in R
13
14
15
JD is the most general form of dependency (read as determination) possible between the attributes of a relation (in the relational model)
17
Activity
Is 4NF subsumed by 5NF? Can you prove this using Fagins theorem and the definitions for 4 and 5 NF?
18
19
Concluding remarks
5NF is the ultimate normal form with respect to projection / join 5NF is guaranteed to be free of all anomalies that can be eliminated via projections determining whether a relation is in 4NF but not in 5NF is still fuzzy
very rare in practice
20
Recap
JD - a more general constraint than MD a relation can be in 4NF and have un-expressed JDs
this results in update anomalies
such a relation can be decomposed (via projection) into an equivalent set of 5NF relations a relation is 5NF if all its JDs are deducible from its candidate keys for a relation in 4NF but not in 5NF, an unexpressed JD is a possible decomposition (towards 5NF)
21
22