ADVANCED DATABASE SYSTEMS DR. FATEMEH AHMADI- ABKENARI SEPTEMBER 2013 1 Object Databases.

Slides:



Advertisements
Similar presentations
Database System Concepts ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com ©Silberschatz, Korth and SudarshanDatabase.
Advertisements

Object Oriented Database Group 4 Mathieu Metz Palani Kumaresan Napa Gavinlertvatana Kristine Pei Keow Lee Prabhu Ramachandran.
Why Object-Oriented DBMS? Abstract data types Interface with host programming language (the impedance mismatch). Object identity: (peter, 40, {(john, 15,
ADVANCED DATABASE SYSTEMS DR. FATEMEH AHMADI- ABKENARI 1 Object Databases.
IS698: Database Management Min Song IS NJIT. The Relational Data Model.
1 Constraints, Triggers and Active Databases Chapter 9.
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
1 Database Design I: The Entity- Relationship Model Chapter 5.
The Entity-Relationship Model
ODMG Standard: Object Model1 OBJECT-ORIENTED DATABASE SYSTEMS ODMG Standard: Object Model Susan D. Urban and Suzanne W. Dietrich Department of Computer.
Chapter Information Systems Database Management.
Object-Orientation in Query Languages By: Toan Nguyen Class: CS 157A.
Chapter 16 Introduction to Object Databases. Copyright © 2005 Pearson Addison-Wesley. All rights reserved What’s in This Module? Motivation Conceptual.
CS 104 Introduction to Computer Science and Graphics Problems Introduction to Database (2) Basic SQL 12/05/2008 Yang Song.
1 Object Oriented & Object Relational Databases Ranga Raju Vatsavai Teaching Mentor (Prof. Shekhar) CSci 5708 : Architecture and Implementation of Database.
Programs with SQL Host language + Embedded SQL Preprocessor Host Language + function calls Host language compiler Host language program Preprocessor Host.
Other Data Models. Text New edition (DBS the complete book): Chapter 4 Old edition (First course in DBS): –Section 2.1 –Section –Section 2.4.1,
Fundamentals, Design, and Implementation, 9/e Chapter 16 Object-Oriented Database Processing.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Object and Object- Relational Databases.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 18 Object Database Management Systems.
1 Announcements Research Paper due Monday November 22.
Databases Illuminated Chapter 7 The Object-Oriented Model.
EER vs. UML Terminology EER Diagram Entity Type Entity Attribute
Object and object-relational databases 1. Object databases vs. Object-relational databases Object databases Stores complex objects – Data + functions.
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
Object-Based Databases. 2 Complex Data Types and Object Orientation Structured Data Types and Inheritance in SQL Table Inheritance Array and Multiset.
22.1Database System Concepts - 6 th Edition Chapter 22: Object-Based Databases Complex Data Types and Object Orientation Structured Data Types and Inheritance.
©Silberschatz, Korth and SudarshanDatabase System Concepts.
Agenda  TMA03  M877 Block 3 Databases with Objects.
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
Object-Based Databases Ghazal Mostofi Sadri. Outline 1.Overview 2.Complex Data Types 3.Structured Types and Inheritance in SQL 4.Table Inheritance 5.Array.
ORDBS1 Object Relational Database Systems: 1. Introduction 2. Objects in SQL3 3. Comparison of ODL/OQL and SQL3 Approaches CIS 671.
Why Object-Oriented DBMS? Abstract data types (relational data model is too simple). Interface with host programming language Managing large number of.
Company LOGO OODB and XML Database Management Systems – Fall 2012 Matthew Moccaro.
1 Advanced Databases (CM036): Lecture # 5 ( Object-Relational and Nested-Relational Databases) Introduction to Object-Relational features of Oracle 9i.
1 Object-Relational Databases User-Defined Types Nested Tables.
1 Object Oriented Databases Week 9. 2 Problems with Flat Relations Consider a relation Person(SSN, Name, PhoneN, Child) with: FD: SSN  Name Any person.
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
Object-Relational SQL CIS 4301 Lecture Notes 4/20/2006.
Object relational database managmement systems (ORDBMS) Adapted by Edel Sherratt from originals by Nigel Hardy.
1 Advanced Databases (CM036) – Lecture # 12: The ODMG Standard for Object Databases Object Query Language (OQL) & Language Binding Advanced Database Technologies.
CSE 6331 © Leonidas Fegaras OODB1 Object-Oriented Databases and the ODMG Standard.
Chapter 2 Object-Relational DBMSs Chapter 28 in Textbook.
Object Relational Features
11-1 CHAPTER 11 Concepts for Object-Oriented Databases.
FEN NOEA/IT - Databases/ORDB1 Object-Relational Databases The Evolutionary Approach to Closing the Gap between Relational Tables and Object Models.
© D. Wong Security and User Authorization in SQL 8.7 pp. 410  Authorization ID = user name  Special authorization ID: PUBLIC  Privileges for:
Object-Relational Model. Review: Data Models Hierarchical Network ER (Pure) Relational (Pure) Object-oriented (ODMG) Object-relational (since SQL:1999)
AND OBJECT-ORIENTED DATABASES OBJECT-RELATIONAL DATABASES.
The ODMG Standard for Object Databases
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 8 Object-Relational Database.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
IST 210 Object Oriented Database. IST 210 Object-Oriented Concepts  Abstract Data Types  Class definition, provides extension to complex attribute types.
Why Object-Oriented DBMS?
Object-Oriented Databases and the ODMG Standard
Object-Relational DBMSs
Information Systems Database Management
Chapter 12 Outline Overview of Object Database Concepts
Translation of ER-diagram into Relational Schema
Relational Databases The Relational Model.
Relational Databases The Relational Model.
Databases.
CREATE, INSERT, SELECT.
Structured Types (9-12-2) Structured types allow composite attributes of E-R diagrams to be represented directly. Unnamed row types can also be used in.
CPSC-608 Database Systems
CSC Database Management Systems
Object – relational database
JDBC II IS
Presentation transcript:

ADVANCED DATABASE SYSTEMS DR. FATEMEH AHMADI- ABKENARI SEPTEMBER Object Databases

2 Limitations of Relational Data Model Blob Binary Large Object Examples MOVIE (Name: String, Director: String, Video: blob) SELECT M. Director FROM MOVIE M WHERE M. Name = ‘ John Smith’ Huge Overhead 1 2 Frames between and ? Only with Specialized operation for a special Blob type e.g. frameRange (from, to) - Video - DNA Sequences - VLSI Chip designs Burdening the database

3 Limitations of Relational Data Model IsA Hierarchies Student Person ER or UML extract STUDENT (SSN: String, Major: String) SELECT S. Name FROM STUDENT S WHERE S. Major = ‘CE’ PERSON (Name: String, SSN: String) Reject by SQL-92 No explicit presence of Name attribute No E-R or UML based query language SELECT P. Name FROM PERSON P, STUDENT S WHERE P.SSN=S.SSN AND S. Major = ‘CE’ More Complex

4 Limitations of Relational Data Model Impedance mismatch in database languages -Database applications are written in host languages such as C or Java - Databases are accessed by executing SQL - SQL is a set oriented language and returns a set of tuples. - Host languages do not support high level operations on relations. - Host Languages are of procedural nature (how) while SQL is of declarative nature (what). Fact Problems

5 Set-valued attributes Limitations of Relational Data Model Relational data model is unable to handle set- valued attributes in natural way. An inevitable redundancy is a result. SSNNamePhoneNChild Joe Public Joe Public Joe Public Joe Public Bob Public Bob Public Bob Public Bob Public Not in Third Normal Form SSN Name If a person has several PhoneN and several Children PERSON (SSN: String, Name: String, PhoneN: String, Child: String )

6 Set-valued attributes Limitations of Relational Data Model PERSON (SSN: String, Name: String, PhoneN:{String}, Child: {String}) Represents set-valued attributes Examples ( , Joe Public, { , }, { , }) If the type of Child attribute were {PERSON} rather than {String}

7 Classes Conceptual Object Data Model (CODM) Similar Objects are organized into Classes Classes play the same role in CODM that Relations play in Relational Databases. In SQL-92 a Database is a set of Relations and each Relation is a set of Tuples. In CODM a Database is a set of Classes and each Class is a set of Objects. A Class has a Type, a Method Signature (a schema) and an Extent. The Method Implementation is not part of CODM. In Object Data Model, two classes can have the Sub/Super Class Relationship or IsA Relationship.

8 Terminology Conceptual Object Data Model (CODM) Extent Extent of a Class The set of all objects in a class Type Type of a Class The common structure of all objects in a class (the collection of types of its components) Method Signature Method Signature of a Class Declarations of operations that can be applied to the objects in a class

The Value part:  Primitive value (A member of Integer, String, Float, …)  Reference value (An oid of an object)  Tuple value: [A1:v1, …, A2:v2]  Set value: {v1, v2} 9 Conceptual Object Data Model (CODM) Objects and Values (# 32, [ SSN: , Name: Joe Public, Phone: {“ ”, “ ”}, Child: {#445, #73}] ) oid (Object ID) Complex Values Arrays List Structures, … In ODMG

10 Conceptual Object Data Model (CODM) Tuple types [ SSN: String, Name: String, Address: [StNumber: Integer, StName: String]] Tuple values exists in relational data model only at top (row) level. In CODM, they can appear at any level.

11 Row Types Objects in SQL 1999/2003 CREATE TABLE PERSON ( Name CHAR (20), Address ROW (Number INTEGER, Street CHAR (20), ZIP CHAR (5) ) SELECT P. Name FROM PERSON P WHERE P. Address. ZIP=‘11987’ Referring tuple types: Path Expression for SELECT ROW Type Constructor for construction of a tuple type ROW Value Constructor INSERT INTO PERSON (Name, Address) VALUES (‘John Doe’, ROW (666, ‘York Ville’, ‘55555’)) UPDATE PERSON SET Address = ROW (21, ‘Shepard Ave’, ‘12345’) WHERE Address = ROW (666, ‘York Ville’, ‘55555’) AND Name = ‘John Doe’ Updating tuple types

12 User-Defined Types (UDT) Objects in SQL 1999/2003 CREATE TYPE PERSONTYPE AS ( Name CHAR (20), Address ROW (Number INTEGER, Street CHAR (20), ZIP CHAR (5) ) CREATE TYPE STUDENTTYPE UNDER PERSONTYPE AS ( Id INTEGER, Status CHAR (2) ) METHOD award_degree () RETURNS BOOLEAN; CREATE METHOD award_degree () FOR STUDENTTYPE LANGUAGE C EXTERNAL NAME ‘file:/…/…/award_degree’; Abstract data type

13 Using User-Defined Types Objects in SQL 1999/2003 CREATE TYPE TRANSCRIPT ( Student STUDENTTYPE, CrsCode CHAR(6), Semester CHAR (6), Grade CHAR(1) ) INSERT INTO TRANSCRIPT (Student, Course, Semester, Grade) VALUES (NEW StudentType().Id ( ). Status (‘H5’). Name (‘John Smith’). Address (ROW (456, ‘Florida Ave’, ‘ ’)), ‘ADS’, ‘F911’ ‘A’) Adding Objects

14 Reference Types Objects in SQL 1999/2003 CREATE TABLE TRANSCRIPT1 ( Student REF (STUDENTTYPE) SCOPE STUDENT2, CrsCode CHAR(6), Semester CHAR (6), Grade CHAR (1) ) Querying reference types SELECT T. Student -> Name, T. Grade FROM TRANSCRIPT T WHERE T. Student -> Address. Street = ‘ Shepard Ave’

15 Inheritance Objects in SQL 1999/2003 CREATE TYPE STUDENTTYPE UNDER PERSONTYPE AS ( Id INTEGER, Status CHAR (2) ) 1 2 CREATE TABLE STUDENT OF STUDENTTYPE UNDER PERSON A supertable for table STUDENT In order for a table T1 to be a subtable of another table T2 the following must hold:  The UDT of T1 must be a subtype of (defined as being UNDER) the UDT of T2.  The table T1 must be defined as being UNDER the table T2.

16 Methods in OQL OQL: The ODMG Object Query Language SELECT M. frameRange (100, 1000) FROM MOVIE M WHERE M. Name = “Film1” Methods can be invoked in SELECT statement MOVIE (Name: String, Director: String, Video: blob) SELECT P. add_ phone_ number (“ ”) FROM PERSONEXT P WHERE P. SSN = “ ” This query changes the database but does not return anything to the caller. The ability to call update methods in the OQL SELECT statement blurs the boundary between the data manipulation and query language.