Download presentation
Presentation is loading. Please wait.
1
NestedRelations: 1 Nested Relations Flat schemas often have replicated data values in their relations. Nested schemas allow us to collapse some of these replicated data values. NrBeds RoomNr (NrBeds ( RoomNr )* )* 2 1 2 1 2 2 2 2 3 3 1 4 1 4 1 5 5
2
NestedRelations: 2 Redundancy in Nested Schemes The redundancy definition is the same as for flat relations. If a hidden value can be uniquely determined or if a value change causes a constraint violation, the value is redundant. (NrBeds (RoomNr (View)* )* )* 2 1 Sea Forest City 2 Sea Forest 3 City (View (RoomNr NrBeds)* )* Sea 1 2 2 2 Forest 1 2 2 2 City 1 2 3 2
3
NestedRelations: 3 NNF: Redundancy Free Nested Schemas Input: a canonical, acyclic, binary hypergraph H. Output: a set of nested schemas with no potential redundancy. Repeat Mark an unmarked node in H as the first attribute in a new nested schema. While an unmarked edge is incident on a marked node A: Mark the edge. If A B: Add B with A; Mark B. If A B: Add B with A; Mark B if all B’s incident edges are marked. If A B: Nest B under A; Mark B. Else (A — B): Nest B under A; Mark B if all B’s incident edges are marked. Until all nodes have been marked
4
NestedRelations: 4 Nested Schema Generation Example 1. (NrBeds, (RoomNr, RoomName, Cost, (View)*, (GuestNr, GuestName)* )* )* 2. (RoomNr, RoomName, Cost, NrBeds, (View)*, (GuestNr, GuestName)* )* 3. (GuestNr, GuestName, RoomNr)* (RoomNr, RoomName, Cost, NrBeds (View)* )*
5
NestedRelations: 5 Redundancy Prevention xa1yb2zxa1yb2z (A ( BC )* )* ax1 y1 2 by1 2 z2 This replication... … causes this redundancy.
6
NestedRelations: 6 Generalization for N-ary Relationship Sets “Composite nodes” can be treated as a single node. –(B C (A)* (D)* )* –(D (B C)* )*; (A B C)* Or, n-ary edges (n 3) can be converted to an object set and n binary relationship sets. NNF, basically: –Schemes should be constructed along hypergraph paths. –Schemes should not violate the natural 1-many hierarchical structure.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.