100 likes | 410 Views
Join Dependencies and Fifth Normal Form. Join Dependencies:.
E N D
Join Dependencies: • A join dependency (JD) denoted by JD (R1, R2, …….Rn) specified on relation schema R, specifies a constraint on the state of R. The constraint states that query legal state r of R should have a lossless join decomposition into R1, R2, …….Rn. ie. for every such r we have, π(πR1(r), πR2(r), ……. πRn(r)) = r.
Join Dependencies (cont…) • A join dependency JD (R1, R2, …….Rn) specified on relation schema R is a trivial JD if one of the relation schema R in JD (R1, R2, …….Rn) is equal to R. Such a dependency is called trivial because it has the lossless join property for any relation state r of R and hence does not specify any constraint on R. R R1 R2 (Decompose) R
Fifth Normal Form (5NF) • Definition: A relation R is in fifth normal form (5NF) if and only if the following conditions are satisfied simultaneously. (i) R is already in 4NF. (ii) If cannot be further non-lossless decomposed [Project – Join normal form with respect to a set f of functional multivalued and join dependencies if, for every non trivial join dependency. • Actually, 5NF is of little practical use for a database designer.
Example 1 Shipments Shipments Join over part numbers
PJ Join over part numbers JS Join over project numbers, supplier numbers Original shipments (Join first two)
Example 2: Dealer – Ports – Customer (DPC) Dealer – Ports (DP) Ports – Customer (PC)
Customer – Dealer (CD) Join over ports DP – DC Join DP – DC with CD over customer and dealer together.
Domain – Key Normal Form (DKNF): The idea behind DKNF is to specify the ultimate normal form that takes into account all possible types of dependencies. Definition: • A relation is in DKNF if every general constraint can be inferred from the knowledge of the attributes involved in the schema their underlying domains and the sets of attributes that from the keys. Example: Course is 3 digit long 000 to 900. Grade is from the set {A,B,C,D,E,F}. Anomalies in DKNF: Insert Anomaly: • It occurs when a tuple is inserted in a relation and the resulting relation violates one or more general constraints. Deletion Anomaly: • It occurs when a tuple from a relation is deleted and the remaining relation violates one or more general constraints.