Text. Additional ODL Concepts OO Model to Relational Model Object-Relational Design OO vs OR. New edition/complete book: Section

Similar documents
Steps in designing a database. Steps in picture. Entity-Relationship Model. Entity Set. Attributes. The Entity-Relationship Data Model

Niklas Fors The Relational Data Model 1 / 17

ODL Design to Relational Designs Object-Relational Database Systems (ORDBS) Extensible Markup Language (XML)

High-Level Database Models. Spring 2011 Instructor: Hassan Khosravi

Object-Relational Database Systems (ORDBS) Contains slides made by Naci Akkøk, Pål Halvorsen, Arthur M. Keller and Vera Goebel.

Chapter 11 Object and Object- Relational Databases

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Introduction to Database Design, fall 2011 IT University of Copenhagen. Normalization. Rasmus Pagh

Chapter 12 Object and Object Relational Databases

3. Object-Oriented Databases

ENTITY-RELATIONSHIP MODEL

Normalization. Anomalies Functional Dependencies Closures Key Computation Projecting Relations BCNF Reconstructing Information Other Normal Forms

Relational Algebra. Spring 2012 Instructor: Hassan Khosravi

CSE 880. Advanced Database Systems. Semistuctured Data and XML

The Entity-Relationship Model. Steps in Database Design

Final Examination Computer Science 420 Dr. St. John Lehman College City University of New York 21 May 2002

Introduction to Databases, Fall 2003 IT University of Copenhagen. Lecture 4: Normalization. September 16, Lecturer: Rasmus Pagh

ITCS Jing Yang 2010 Fall. Class 16: Object and Object- Relational Databases (ch.11) References

COURSE 11. Object-Oriented Databases Object Relational Databases

Object-Oriented Database Languages. Object Description Language Object Query Language

Programming and Database Fundamentals for Data Scientists

CMPT 354 Database Systems I

Information Systems Engineering. Entity Relationship Model

W5.L2. Week 5, Lecture 2

Information Systems Engineering

Systems Analysis and Design in a Changing World, Fourth Edition. Chapter 12: Designing Databases

Set Operations, Union

Chapter 21 9/4/2012. Object Database Standards, Languages, and Design. Chapter 21Outline. Chapter Objectives. ODMG Objects and Literals

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 21 1

High Level Database Models

OVERVIEW OF DATABASE DEVELOPMENT

Object Database Standards, Languages, and Design

Concepts from

Concepts for Object-Oriented Databases

2.1. Concepts for Object Databases

Exam I Computer Science 420 Dr. St. John Lehman College City University of New York 12 March 2002

Introduction to Databases, Fall 2005 IT University of Copenhagen. Lecture 2: Relations and SQL. September 5, Lecturer: Rasmus Pagh

CS/INFO 330 Entity-Relationship Modeling. Announcements. Goals of This Lecture. Mirek Riedewald

Course Content. Object-Oriented Databases. Objectives of Lecture 6. CMPUT 391: Object Oriented Databases. Dr. Osmar R. Zaïane. University of Alberta 4

2. E/R Design Considerations

Contents. Database. Information Policy. C03. Entity Relationship Model WKU-IP-C03 Database / Entity Relationship Model

The Entity-Relationship Model. Overview of Database Design

Project Assignment 2 (due April 6 th, 2016, 4:00pm, in class hard-copy please)

The Entity-Relationship (ER) Model

Conceptual Design. The Entity-Relationship (ER) Model

Information Systems for Engineers. Exercise 10. ETH Zurich, Fall Semester Hand-out Due

CIS 330: Web-driven Web Applications. Lecture 2: Introduction to ER Modeling

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

CS 4604: Introduction to Database Management Systems. B. Aditya Prakash Lecture #5: Entity/Relational Models---Part 1

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation

Relational Database Design Part I. Announcements (September 5) Relational model: review. CPS 116 Introduction to Database Systems

The Entity-Relationship Model. Overview of Database Design. ER Model Basics. (Ramakrishnan&Gehrke, Chapter 2)

Chapter 6: Entity-Relationship Model. E-R Diagrams

The Entity-Relationship Model

SYLLABUS ADMIN DATABASE SYSTEMS I WEEK 2 THE ENTITY-RELATIONSHIP MODEL. Assignment #2 changed. A2Q1 moved to A3Q1

Introduction to Database Design. Dr. Kanda Runapongsa Dept of Computer Engineering Khon Kaen University

Object-Oriented Software Engineering. Chapter 2: Review of Object Orientation

The Entity-Relationship Model

Introduction to Databases Object and Object-Relational Databases

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

Relational Database Design: Part I. Introduction to Databases CompSci 316 Fall 2017

Credit where Credit is Due. Last Lecture. Goals for this Lecture

EECS-3421a: Test #1 Design

Chapter 9: Relational DB Design byer/eer to Relational Mapping Relational Database Design Using ER-to- Relational Mapping Mapping EER Model

Announcement. Relational Database Design Part I. Keys. Relational model: review. Schema vs. data. More examples of keys

Ch. 21: Object Oriented Databases

Overview of db design Requirement analysis Data to be stored Applications to be built Operations (most frequent) subject to performance requirement

The Entity-Relationship Model (ER Model) - Part 2

Databasesystemer, forår 2006 IT Universitetet i København. Forelæsning 9: Mere om SQL. 30. marts Forelæser: Esben Rune Hansen

Introduction to Data Management. Lecture #6 E-Rà Relational Mapping (Cont.)

A database can be modeled as: + a collection of entities, + a set of relationships among entities.

Birkbeck. (University of London) BSc/FD EXAMINATION. Department of Computer Science and Information Systems. Database Management (COIY028H6)

How To Convert An Er Diagram Into Relational Schema Example

Introduction to Data Management. Lecture #3 (Conceptual DB Design) Instructor: Chen Li

Database Management

DC62 Database management system JUNE 2013

Steps in normalisation. Steps in normalisation 7/15/2014

Conceptual Design with ER Model

Databases - Relations in Databases. (N Spadaccini 2010) Relations in Databases 1 / 16

Answer Key for Exam II Computer Science 420 Dr. St. John Lehman College City University of New York 18 April 2002

Data Modeling with the Entity Relationship Model. CS157A Chris Pollett Sept. 7, 2005.

Conceptual Data Models for Database Design

The Entity-Relationship (ER) Model 2

CSE 135. Applications View of a Relational Database Management System (RDBMS) SQL. Persistent data structure. High-level API for access &modification

Database Applications (15-415)

1. (a) Explain the Transaction management in a database. (b) Discuss the Query Processor of Database system structure. [8+8]

CS54100: Database Systems

Relational Database Design Part I. Announcement. Relational model: review. CPS 116 Introduction to Database Systems

Relational Database Design. Announcements. Database (schema) design. CPS 216 Advanced Database Systems. DB2 accounts have been set up

DATABASE MANAGEMENT SYSTEMS

Modeling Your Data. Chapter 2. cs542 1

Advanced Database Applications. Object Oriented Database Management Chapter 13 10/29/2016. Object DBMSs

Topic 5: Mapping of EER Diagrams to Relations

Outline. CUGS Core - Databases. Requirements. Work method. Databanks/Databases. Databank

Introduction. Course Overview Evolution and History of Database Management Systems Requirements of Object-Oriented Database Management Systems

Chapter 2. Database Design. Database Systems p. 25/540

Introduction to Database Systems. Announcements CSE 444. Review: Closure, Key, Superkey. Decomposition: Schema Design using FD

CMPT 354 Views and Indexes. Spring 2012 Instructor: Hassan Khosravi

Introduction to Database Design

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1

Transcription:

Additional ODL Concepts OO Model to Relational Model Object-Relational Design OO vs OR Text New edition/complete book: Section 4.3-4.5 Old edition: 2.4.1, 2.4.2 2.5.2, 2.5.5 3.2 (all subsections) 3.4.1 1

Topics More on type: Bag, set, and list Array, dictionary, and structures Multiway relationship Subclasses and inheritance Keys Extent Bag, set, and list Set: a set of objects of the same type, no repetition allowed, declared by Set<T> where T is a type. Bag: set of objects of the same type, repetition allowed, declared by Bag<T> where T is a type. List: set of ordered objects of the same type, repetition allowed, declared by List<T> where T is a type. 2

Array, dictionary, and structures Array: a list whose length is predefined, declared by Array<T,i> - a list of i elements of type T Dictionary: declared by Dictionary<T,S>, whose value is a set of pair, each pair consists of a value of type T (key) and a value of type S (range) Structure: Struct N {T 1 F 1,,T n F n } (T i are types and F i are names) Rules on types of relationships and attributes Type of a relationship is either a class type or a collection type constructor applied to a class type. Type of an attribute can be an arbitrary, possible type. 3

Multiway relationship Stars Movies Star_of Stars Movies Contracts Movie_of Producing studio Studios Contracts Studio of star Studios class Contract { relationship Movie themovie inverse Movie::contractsFor; relationship Star thestar inverse Star::contractsFor; } In Movie: relationship Set<Contract> contractsfor inverse Contract::theMovie; Convert to binary relationship and follow the rule! Subclasses declared with extends class Cartoon extends Movie { relationship Set<Star> voices; } class MurderMystery extends Movie { attribute string weapon; } 4

Inheritance Multiple inheritance: list of classes, separated by : after extends class CartoonMurderMystery extends MurderMystery : Cartoon Conflict might arise different solutions: disallowed specifying clearly from which property are inherited from which class adding new attributes/relationships to avoid conflicts Extent The set of objects of a class that exists at a given time - difference from the class declaration (similar to instance vs schema) Can have different name declared explicitly with the keyword extent Example: class Movie (extent Movies) (the name of the extent is Movies) 5

Keys Optional Declared by key word key/keys Allow relationships to be part of key Example: class Movie (extent Movies key (title,year) (another key here) (another key here) ) Interface Class definition with no associated extent Declaration with keyword interface Enable the existence of several (extent of) classes with the same properties interface C { } ; class C1 extends C (extent C11) { extra properties }; class C2 extends C (extent C21) { extra properties }; Two extents of C (C11 and C21) can exist two together. 6

From ODL to Relational Design Problems: no key non-atomic values for attributes methods in object definition Attributes to attributes atomic: straightforward non-atomic: structure set-value (or collection typed value) Relationships Methods OLD Attributes to Relational Attributes Atomic: one-to-one correspondence Non-atomic: case-by-case Structure: one attribute for atomic component of the structure, renaming if necessary Set: approach to deal with structure can be used Bag: add a new attribute count to distinguish object List: add a new attribute position to record the order of the object Array: introduce attributes for each array Dictionary: similar to set value 7

Problem Obtained relational schemas might not be in BCNF (others as well) To get optimal solution: conversion then normalization ODL Relationships to Relation Similar to conversion of E/R relationships to relations: key of two objects OLD Relationships come in pairs: one only Combining techniques can be used applicability depends on the multicity of the relationship. Example: class Movie (extent Movies key (title,year)){ relationship Set<Star> stars inverse Star::starredIn; } we need only one relation starredin(title, year, starname) even though starredin will appear as a relationship in the declaration of the class Star. 8

Object-Relational Model Relational model with object-oriented features: structured types for attributes (removing atomic requirement) methods (applied on user-defined types) identifiers for tuples (similar to OID) references Nested Relations Attributes need not be atomic: Stars(name, address(street,city), birthdate, movies(title, year)) name address birthdate movie Fisher street city 9/9/99 title year Mapple H wood Star War 1977 Locust Malibu Empire 1980 Hamill street city 8/8/88 title year Oak B wood Star War 1977 Return 1983 9

References Specify by {*R} where R is the referred relation Stars(name, address(street,city), birthdate, movies({*movies})) This implies that the attribute movie of the Stars relation is a set of references to tuples in the Movies relation The Stars example with Reference name address birthdate movie Fisher street city 9/9/99 Mapple H wood title year Locust Malibu Star War 1977 Hamill street city 8/8/88 Return Empire 1983 1980 Oak B wood 10

Object-oriented vs Object-relational Similar features: Objects in OO model could be represented as tuples in OR model (due to the introduction of set and references) Extents and relations: use interface to overcome the restriction of one extent with one class Methods: implemented in OR DBMS Type systems: almost the same References and OID: references are not necessary hidden from users, OID does Backward compatibility: OR does but not OO possible reason for popularity of OR vs OO Conversion from OO to OR: simpler than OO to Relational Model mostly straightforward (one-to-one correspondence) otherwise, use the techniques of OO to Relational 11