NestedRelations: 1 Nested Relations Flat schemas often have replicated data values in their relations. Nested schemas allow us to collapse some of these.

Slides:



Advertisements
Similar presentations
Some Properties of SSA Mooly Sagiv. Outline Why is it called Static Single Assignment form What does it buy us? How much does it cost us? Open questions.
Advertisements

Depth-First Search1 Part-H2 Depth-First Search DB A C E.
Compiler Construction Sohail Aslam Lecture Finite Automaton of Items Then for every item A →  X  we must add an  -transition for every production.
Graphs III (Trees, MSTs) (Chp 11.5, 11.6)
Designing Indexing Structure for Discovering Relationships in RDF Graphs Stanislav Bartoň.
Graphs By JJ Shepherd. Introduction Graphs are simply trees with looser restrictions – You can have cycles Historically hard to deal with in computers.
FUNDAMENTAL PROBLEMS AND ALGORITHMS Graph Theory and Combinational © Giovanni De Micheli Stanford University.
Chapter Design Objectives Obtain the theoretically “best” design (normalize) –Remove redundancy and update anomalies –Remove nulls –Minimize the.
P and NP Sipser (pages ). CS 311 Fall Polynomial time P = ∪ k TIME(n k ) … P = ∪ k TIME(n k ) … TIME(n 3 ) TIME(n 2 ) TIME(n)
Binary Decision Diagrams. ROBDDs Slide 2 Example Directed acyclic graph non-terminal node terminal node What function is represented by the graph?
XNF: 1 XML and NNF A Standard Form for XML Documents (XNF) Properties –As few hierarchical trees as possible –No redundant data values in any tree Method.
Chapter Abstraction Concrete: directly executable/storable Abstract: not directly executable/storable –automatic translation (as good as executable/storable)
FDImplication: 1 Functional Dependencies (FDs) Let r(R) be a relation and let t  r, then the restriction of t to X  R, written t[X], is the projection.
Graphs and Trees This handout: Trees Minimum Spanning Tree Problem.
Mappings & Normal Form Guarantees. Can Mappings of Diagrams Yield Normalized Schemas? “Yes”—but only if canonical. Most (?) diagrams are canonical. Mappings.
OSM—Normalize Then Map. ER Model Instance Type  RackRate Room Date  Guest Rate Discount Date  Discount Rate = (1 – Discount/100)  RackRate includes.
Chapter Nested Schemes Flat schemes often have replicated data values. Nested schemes allow us to collapse some of these replicated data values.
Information Resources Management February 13, 2001.
Producing XML Documents with Guaranteed “Good” Properties David W. Embley Brigham Young University Wai Y. Mok University of Alabama in Huntsville Sponsored.
1 Regular Grammars Generate Regular Languages. 2 Theorem Regular grammars generate exactly the class of regular languages: If is a regular grammar then.
Chapter Database Design Purpose: organize to achieve efficiency, … Considerations –time/space tradeoff for application –balance application characteristics,
XNF-1 XML and NNF A Standard Form for XML Documents (XNF) Properties –As few hierarchical trees as possible –No redundant data values in any tree Method.
Taylor Expansion Diagrams (TED): Verification EC667: Synthesis and Verification of Digital Systems Spring 2011 Presented by: Sudhan.
OSM & Allegro. OSM Object-oriented Systems Modeling Components: –Object Relationship Model Object sets—lexical and non-lexical Relationship sets Generalization/specialization.
Create, Insert, Delete, Update. Create Create database Create table Create index – Primary – Secondary.
CostAnalysis: 1 Cost Analysis Rule-of-Thumb Guidelines As a guide, consider denormalizing if: –redundancy is minimal and update anomalies are not expected.
QueryRewriting: 1 Query Rewriting (for Query “Optimization”) Main Strategy: Make intermediate results small by applying selection and projection early.
Chapter Implementation Faithful translation of a design into a target environment Design should be free of target-environment dependencies Should.
Design Algorithm Essentials 1.Combine functional edges with the same tail object set(s) into a scheme. (The tail object set(s) and any others in a 1-1.
MVDs: 1 Join Dependencies—Example Let r = A B C = A B |  | A C 1 a x 1 a 1 x 1 a y 1 b 1 y 1 b x 2 a 2 y 1 b y 2 b 2 a y 2 b y Observe: r =  AB r | 
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER-to- Relational Mapping.
1 The ORA-SS Approach for Designing Semistructured Databases Xiaoying Wu, Tok Wang Ling, Mong Li Lee National University of Singapore Gillian Dobbie University.
Normalisation Example CS2312. Normalisation Example BEER_DATABASE Additional Notes: Warehouses are shared by breweries. Each beer is unique to the brewer.
Chapter 91 ER & EER to Relational Mapping. Chapter 92 ER to Relational Mapping Step 1: For each regular entity type E in the ER schema, create a relation.
Attribute Grammars Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 17.
CS143 Review: Normalization Theory Q: Is it a good table design? We can start with an ER diagram or with a large relation that contain a sample of the.
Introduction to Graphs. Introduction Graphs are a generalization of trees –Nodes or verticies –Edges or arcs Two kinds of graphs –Directed –Undirected.
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
Trees & Forests D. J. Foreman. A Forest A BC R ST DE F.
Fundamental Data Structures and Algorithms (Spring ’05) Recitation Notes: Graphs Slides prepared by Uri Dekel, Based on recitation.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
DatabaseIM ISU1 Chapter 7 ER- and EER-to-Relational Mapping Fundamentals of Database Systems.
Object-Relational Model. Review: Data Models Hierarchical Network ER (Pure) Relational (Pure) Object-oriented (ODMG) Object-relational (since SQL:1999)
Chapter 15 & 16 Conceptual and Logical Database Design Methodology Thomas Connolly, Carolyn Begg, Database System, A Practical Approach to Design Implementation.
Foundation of Computing Systems
RelAlg: 1 Relational Algebra An Algebra is a pair: (set of values, set of operations) Note that an algebra is the same idea as an ADT Relational Algebra:
Trees Dr. Yasir Ali. A graph is called a tree if, and only if, it is circuit-free and connected. A graph is called a forest if, and only if, it is circuit-free.
Data Structures Lakshmish Ramaswamy. Tree Hierarchical data structure Several real-world systems have hierarchical concepts –Physical and biological systems.
Extended ER Mappings & Models. General Principle #1 Graphical representations dictate cardinality relationships among attributes. When graphical representations.
SQL: 1 SQL Correspondence with Relational Algebra select A from r where B = 1 Assume r(AB) and s(BC). select B from r except select B from s select A as.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
1 Storing and Maintaining Semistructured Data Efficiently in an Object- Relational Database Mo Yuanying and Ling Tok Wang.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
Binary Decision Diagrams Prof. Shobha Vasudevan ECE, UIUC ECE 462.
Animated Conversion of Regular Expressions to C Code On the regular expression: ((a ⋅ b)|c) *
Fibonacci Heaps. Fibonacci Binary insert O(1) O(log(n)) find O(1) N/A union O(1) N/A minimum O(1) O(1) decrease key O(1) O(log(n)) delete O(log(n) O(log(n))
Programming Language Concepts
Section 8.1 Trees.
Additive and Multiplicative Relationships
Normalisation Exercise
Minimum Spanning Tree.
CSE 373 Data Structures and Algorithms
Animated Conversion of Regular Expressions to C Code
Trees & Forests D. J. Foreman.
Forests D. J. Foreman.
Graphs Part 2 Adjacency Matrix
Minimum Spanning Trees
CSE 373: Data Structures and Algorithms
CSE 373: Data Structures and Algorithms
Presentation transcript:

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 )* )*

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 Forest City

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

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)* )*

NestedRelations: 5 Redundancy Prevention xa1yb2zxa1yb2z (A ( BC )* )* ax1 y1 2 by1 2 z2 This replication... … causes this redundancy.

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.