Presentation is loading. Please wait.

Presentation is loading. Please wait.

Join Dependencies and Fifth Normal Form

Similar presentations


Presentation on theme: "Join Dependencies and Fifth Normal Form"— Presentation transcript:

1 Join Dependencies and Fifth Normal Form

2 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.

3 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

4 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.

5 Example 1 Shipments Supplier number Part number Project number S1 P1
Join over part numbers

6 PJ Part number Supplier number P1 J2 P2 J1 Join over part numbers JS Project number Supplier number J2 S1 J1 S2 Join over project numbers, supplier numbers Original shipments Part number Project number Supplier number S1 P1 J2 P2 J1 S2 J (Extra) (Join first two)

7 Example 2: Dealer – Ports – Customer (DPC) Dealer Ports Customer D1 P1 C1 C2 P2 D2 Dealer – Ports (DP) Dealer Ports D1 P1 P2 D2 Ports – Customer (PC) Ports Customer P1 C1 C2 P2

8 Customer – Dealer (CD) Customer Dealer C1 D1 C2 D2 Join over ports DP – DC Dealer Ports Customer D1 P1 C1 C2 P2 D2 C (Extra) Join DP – DC with CD over customer and dealer together. Dealer Ports Customer D1 P1 C1 P2 C2 D2

9 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.


Download ppt "Join Dependencies and Fifth Normal Form"

Similar presentations


Ads by Google