1 III) COMPLEX VALUE DATABASES. 2 Introduction l Relax the 1 Normal Form of the Relational Model  Set-value attributes (e.g., set of tuples => Relations)

Slides:



Advertisements
Similar presentations
Relative Information Capacity of Simple Relational Database Schemata Paper by: Richard Hull Presented by: Jose Picado.
Advertisements

CS848: Topics in Databases: Foundations of Query Optimization Topics covered  Introduction to description logic: Single column QL  The ALC family of.
From the Calculus to the Structured Query Language Zachary G. Ives University of Pennsylvania CIS 550 – Database & Information Systems September 22, 2005.
1 CHAPTER 4 RELATIONAL ALGEBRA AND CALCULUS. 2 Introduction - We discuss here two mathematical formalisms which can be used as the basis for stating and.
1 541: Relational Calculus. 2 Relational Calculus  Comes in two flavours: Tuple relational calculus (TRC) and Domain relational calculus (DRC).  Calculus.
1 Relational Calculus Chapter 4 – Part II. 2 Formal Relational Query Languages  Two mathematical Query Languages form the basis for “real” languages.
1 Relational Algebra & Calculus. 2 Relational Query Languages  Query languages: Allow manipulation and retrieval of data from a database.  Relational.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
Relational Calculus. Another Theoretical QL-Relational Calculus n Comes in two flavors: Tuple relational calculus (TRC) and Domain relational calculus.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Relational Algebra Chapter 4, Part A.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 The Relational Algebra and Relational Calculus.
SPRING 2004CENG 3521 E-R Diagram for the Banking Enterprise.
CS405G: Introduction to Database Systems Final Review.
1 Relational Algebra and Calculus Yanlei Diao UMass Amherst Feb 1, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Relational Calculus R&G, Chapter 4   We will occasionally use this arrow notation unless there is danger of no confusion. Ronald Graham Elements of Ramsey.
Introduction to Database Systems 1 Relational Calculus Relational Model : Topic 2.
Dr. Alexandra I. Cristea CS 319: Theory of Databases: C6.
Rutgers University Relational Calculus 198:541 Rutgers University.
CS848: Topics in Databases: Foundations of Query Optimization Topics Covered  Databases  QL  Query containment  More on QL.
1 Relational Algebra and Calculus Chapter 4. 2 Relational Query Languages  Query languages: Allow manipulation and retrieval of data from a database.
1 Spring 2000 Christophides Vassilis IV) EXTENTED RELATIONAL DATABASES Stored Procedures.
CS609 Introduction. Databases Current state? Future?
Ming Fang 6/12/2009. Outlines  Classical logics  Introduction to DL  Syntax of DL  Semantics of DL  KR in DL  Reasoning in DL  Applications.
1 Spring 2000 Christophides Vassilis VI) OBJECT DATABASES.
Understanding Relational Database Query Languages WinRDBI Windows-based Relational DataBase Interpreter An educational tool that.
The Relational Model: Relational Calculus
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Relational Calculus Chapter 4, Section 4.3.
1 CS 430 Database Theory Winter 2005 Lecture 6: Relational Calculus.
Lecture 05 Structured Query Language. 2 Father of Relational Model Edgar F. Codd ( ) PhD from U. of Michigan, Ann Arbor Received Turing Award.
Chapter 2 Adapted from Silberschatz, et al. CHECK SLIDE 16.
Chapter 8 Relational Calculus. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.8-2 Topics in this Chapter Tuple Calculus Calculus vs. Algebra.
CSE314 Database Systems The Relational Algebra and Relational Calculus Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Database Management Systems, R. Ramakrishnan1 Relational Calculus Chapter 4.
1 Relational Algebra. 2 Relational Query Languages v Query languages: Allow manipulation and retrieval of data from a database. v Relational model supports.
1 SIGMOD 2000 Christophides Vassilis On Wrapping Query Languages and Efficient XML Integration V. Christophides, S. Cluet, J Simeon Computer Science Department,
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Relational Algebra.
Relational Calculus Zachary G. Ives University of Pennsylvania CIS 550 – Database & Information Systems September 17, 2007 Some slide content courtesy.
Relational Calculus R&G, Chapter 4. Relational Calculus Comes in two flavors: Tuple relational calculus (TRC) and Domain relational calculus (DRC). Calculus.
1 Spring 2000 Christophides Vassilis II) RELATIONAL DATABASES.
1 Relational Algebra & Calculus Chapter 4, Part A (Relational Algebra)
1 Relational Algebra and Calculas Chapter 4, Part A.
1.1 CAS CS 460/660 Introduction to Database Systems Relational Algebra.
Relational Algebra.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Database Management Systems Chapter 4 Relational Algebra.
Chapter 2 Introduction to Relational Model. Example of a Relation attributes (or columns) tuples (or rows) Introduction to Relational Model 2.
IST 210 The Relational Language Todd S. Bacastow January 2004.
CS 338Relational Algebra4-1 Relational Algebra Lecture Topics Basic concepts and operations of relational algebra Reference, selection, projection Cross-product.
CS848: Topics in Databases: Information Integration Topics covered  Databases  QL  Query containment  An evaluation of QL.
CS 157B Database Systems Dr. T Y Lin. Updates 1.Red color denotes updated data (ppt) 2.Class participation will be part of “extra” credits to to “quiz.
CSC271 Database Systems Lecture # 7. Summary: Previous Lecture  Relational keys  Integrity constraints  Views.
1 CSE544 Monday April 26, Announcements Project Milestone –Due today Next paper: On the Unusual Effectiveness of Logic in Computer Science –Need.
Relational Calculus Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY courtesy of Joe Hellerstein for some slides.
Copyright © 2004 Pearson Education, Inc.. Chapter 6 The Relational Algebra and Relational Calculus.
Database Management Systems, R. Ramakrishnan1 Relational Calculus Chapter 4, Part B.
M.Sc. Seminar - Keren Lenz Supervisor - Dr. Yossi Gil July 1 st 2007 Simple and Safe SQL Queries with C++ Templates A RA R AT -
The Relational Model of Data Prof. Yin-Fu Huang CSIE, NYUST Chapter 2.
CSE-291: Ontologies in Data Integration Department of Computer Science & Engineering University of California, San Diego CSE-291: Ontologies in Data Integration.
CS589 Principles of DB Systems Fall 2008 Lecture 4b: Domain Independence and Safety Lois Delcambre
Midterm Review. Main Topics ER model Relational model Relational Database Design (Theory)
Relational Algebra & Calculus
Module 2: Intro to Relational Model
Relational Algebra Chapter 4, Part A
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
Example of a Relation attributes (or columns) tuples (or rows)
Chapter 2: Intro to Relational Model
Relational Algebra & Calculus
CSE544 Wednesday, March 29, 2006.
CS589 Principles of DB Systems Fall 2008 Lecture 4b: Domain Independence and Safety Lois Delcambre
Presentation transcript:

1 III) COMPLEX VALUE DATABASES

2 Introduction l Relax the 1 Normal Form of the Relational Model  Set-value attributes (e.g., set of tuples => Relations) l Alternative Names: N1NF, NF2, and Nested Relations Models l Three simultaneous innovating approaches:  INRIA : VERSO Database Machine (M. Scholl & S. Abiteboul & F. Bancillon & N. Bidoit & al)  University of Texas 1983: N1NF (P. Fisher & S. Thomas)  IBM Heidelberg + Darmstand : DASDBS NF2 Relational database (G. Jaeschke, H. Schek, P. Pistor, M. H. Scholl) l No programming languages l Only experimental prototypes

3 A Model for Complex Values Set of Atomic values: D =  D i, where D i are atomic domains such as strings, integers, reals, etc. l Set of Attribute names A l Set of Complex values:  each element v of D is a complex value  if v1, v2,..., vn are structured values and a1, a2,..., an are attribute names then [a1:v1, a2:v2,..., an:vn] is a complex value, called tuple  if v1, v2,..., vn are structured values then {v1, v2,..., vn} is a complex value, called set ò NOTE: In N1NF Models the set and tuple value constructors can be applied only alternatively  is not possible to represent set of sets or tuples of tuples

4 Complex Values: Examples l In the FineArt database we want to represent artists with their work u From a relational perspective we have the multi-valued dependency: Name ->-> Artifacts

5 Complex Value Types l Set of Atomic types: STRING, INT, REAL l Set of Attribute names A l Set of types for Complex values:  each atomic type is a type  if t1, t2,..., tn are types and a1, a2,..., an are attribute names then [a1:t1, a2:t2,..., an:tn] is a tuple type  if t is a type then {t} is a set type l EXAMPLE: The type (sort) of the FINE-ART N1NF Relation is: {[Name: STRING, Style: STRING, Artifacts: {[Title: STRING]}, Live-Time: STRING, Nationality: STRING]}

6 Typing: DB vs. PL view l Types in PL:  Part of the program  Focus on variables and functions  Used to avoid inconsistent computations  Type checking is mainly a static activity (compiler) l Types in DB:  Part of the schema  Focus on data  Used to check semantic integrity  Type checking could be also a dynamic activity (run time) l NOTE: The conception of good constructs in DBPL is twofold:  Support a type system for data modeling  Support a data model for program typing

7 Toward a Formalization of Complex Value Databases A schema S is a triple (N, T,  ) :  N is a set of names (e.g., relation names)  T is a set of types   is a function from N to T The Extension (Interpretation) I of a name n is the set of values (instances) of sort  (n) A Database instance is a mapping of the schema S names n such that for each n in S, I(n) is a set of values of sort  (n)

8 Complex value Query Languages: Algebra l Uses relation names + constants + new operations u Basic Set Operations: Union, Intersection and Difference u Constructive Operations: PowerSet, Tuple_create, Set_create u Destructive Operations: Flatten, Tuple_destroy u Restructuring Operations: Nest and Unnest u Filtering Operations: Selection, Projection, Renaming u Additional Operations: Cross Product, Join

9 Complex Value Algebraic Operators B b1 b2 b1 b2 b1 PowerSet B b1 b2 Flatten {[B:T]} {{[B:T]}} Join A a2 B CD a1 c1 c2 d1 d2 d3 c2 c3 EF e1 f1 Product {[E:T 1, F:T 2 ]} {[A:T 3, B:{[C:T 4, D:T 5 ]}]} {[B:T]} {{[B:T]}} {[E:T 1, F:T 2, A:T 3, B:{[C:T 4, D:T 5] }]} B b2 B B CD A a2 B CD a1 c1 c2 d1 d2 d3 c2 c3 CD EF e1f1 e1 f1 A a2 B CD a1 c1 c2 d1 d2 d3 c2 c3 CD AE a2 e1 {[A:T 1, E:T 4 ]} {[A:T 1, B:{[C:T 2, D:T 3 ]}]} A a2 B d2 d3 c2 c3 CD E e1 {[ A:T 1, B:{[C:T 2, D:T 3 ]}, E:T 4 ]} B b1 b2 b1 B b2 B B B

10 Complex Value Algebraic Operators A a2 B d2 d3 c2 c3 CD BB B d2 d3 c2 c3 CD d2 d3 c2 c3 CD Tuple_ destroy d2 d3 c2 c3 CD Flatten PowerSet CD c2 d2 d3c3 CD CD d2 d3 c2 c3 CD Tuple_ create B B CD c2d2 d3c3 CD B d2 d3 c2 c3 CD d2 d3 c2 c3 CD { [A:T 1, B:{ [C:T 2, D:T 3 ] } ] }{ [B:{ [C:T 2, D:T 3 ] } ] }{ { [C:T 2, D:T 3 ] } }{ [C:T 2, D:T 3 ] } { { [C:T 2, D:T 3 ] } } { [B: [C:T 2, D:T 3 ]] }

11 Complex Value Query Examples l Find the artifacts of Impressionist artists ( Flatten(Tuple_destroy (  Artifacts (  Style=‘Impressionist’ ( FINEART )))))

12 Complex Value Unnest & Nest R1 = Unnest Artifacts (FINEART)

13 Complex Value Unnest & Nest R2= Nest ArtWork= Name,Title,Live-Time,Nationality (R1)

14 Complex Value Unnest & Nest l Unnest is the right inverse of nest, whereas unnest is in general not information preserving Nest Artifacts=Title (Unnest Artifacts (FINEART)))  FINEART Unnest Artifacts (Nest Artifacts=Title ( R1))) = R1 l Why? u Grouped attributes may be empty u Remaining attributes may have the same values

15 Complex Value Query Languages: Calculus l Relies on (first-order) relational calculus + quantification over set (second-order) + many sorted (complex value types) u Alphabet of constants D (complex values) + a set V of variable names + a set A of attribute names u Terms:  constants of D (e.g. 1, [name: ”Vassilis”], etc.)  variables of V (e.g., X, Y, Z, etc.)  expressions of the form t.a where a an attribute of A and t a tuple term  Positive Literals: R(t), t = t’, t  t’, t < t’  Well Formed Formulas: and, not, exists, forall  Query: {X |  } where X is the only free variable in  l Range Restrictions to formulae variables guarantee safety of calculus l Set-type Variables + PowerSet result in more expressive power than the relational calculus (equivalent to Datalog-Transitive Closure) l THEOREME: The above complex value algebra and the safe calculus have the same expressive power [Kupper, Abiteboul, Grumbach, Beeri]

16 A Critic of Complex Value Databases l Compared to the Relational Model u More Complex Attribute Values u Typed Data Model u Expressive Power of N1NF Languages l But u No Object Identity (Data Sharing) u No Programming Language (Extensibility, Flexibility)