Object Relational Data Model - Advanced Database Systems | CSE 880, Study notes of Deductive Database Systems

Material Type: Notes; Professor: Pramanik; Class: Advanced Database Systems; Subject: Computer Science & Engineering; University: Michigan State University; Term: Spring 2008;

Typology: Study notes

Pre 2010

Uploaded on 07/23/2009

koofers-user-awm
koofers-user-awm 🇺🇸

10 documents

1 / 14

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE 880
Advanced Database Systems
Object Relational Data Model
S. Pramanik
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Object Relational Data Model - Advanced Database Systems | CSE 880 and more Study notes Deductive Database Systems in PDF only on Docsity!

CSE 880

Advanced Database Systems

Object Relational Data Model

S. Pramanik

Introduction

1. Relations remain the fundamental con-

cept.

2. Domains include complex values (e.g.

structures).

3. System and user defined data types

4. SQL extended to deal with richer data

types

7. SQL for relational model does not

map naturally into host languages such

as C++ (high impedance).

Nested Relations

1. Relation is a set of tuples; why not

use relation to handle set valued at-

tributes. Nested relational model has

been proposed to define attributes of

type relation.

2. This makes relations non-first nor-

mal form.

3. Extensions to relational algebra and

sql have been proposed.

4. Attribute type can be a relation schema

which leads to the following recursive

definition of types of attributes and

types of relations.

(a) attribute type is of atomic type

(b) A relation type (schema) consists

Example:

Non-1NF Table for course: CourseNo Teachers/OfcHr Texts/Pub


c1 {t1/o1,t2/o2} {x1/p1,x2/p2} c2 {../..,../..} {../..,../..} 1NF table for course: CourseNo Teachers OfcHr Texts Pub


c1 t1 o1 x1 p c1 t1 o1 x2 p c1 t2 o2 x1 p c1 t2 o2 x2 p c .. .. .. .. 4NF decomposition for course to minimize redundancies: (based on multivalued dependency) CT: | CX: | XP: CourseNo Teachers OfcHr | CourseNo Texts | Text Pub ------- ------- ----- | -------- -----| ---- --- c1 t1 o1 | c1 x1 | x1 p c1 t2 o2 | c1 x2 | x2 p c2 .. .. | c2 .. | .. ..

Nested Relation for course (non-first normal form (not flat)): CourseNo Teachers Texts


| T O | | X P | |--- ---| |------| c1 | t1 o1 | | x1 p1| | t2 o2 | | x2 p2|


c2 | .. .. | | .. ..|

  1. Schema for nested relation course: course(courseNo,Teachers(T,O),Texts(X,P))

6. Example:

Assume the following nested|Relation CTX |Relation relation CTX: |using references: |teachers: Course Teachers Texts |Course Texts Teachers| No |No | T O ----- -------- ----- |----- ----- --------|--- --- | T O | | X P | | | X P | O------>t1 o |--- ---| |--- ---| | |--- ---| O------>t2 o c1 | t1 o1 | | x1 p1 | | c1 |x1 p1 | | ^ | t2 o2 | | x2 p2 | | |x2 p2 | | | ------------------------- |--------------------- | | | T O | | X P | | | X P | | | |--- ---| |--- ---| | c2 |--- ---| O-----|--| c2 | t1 o1| |x3 p3 | | | x3 p3| O-----|--| | t2 o2| | | | | | |

  1. Schema with referencing attribute: CTX(courseNo, Texts(X,P), Teachers(*teachers) With decomposition: CTX(courseNo, Texts(X,P), Tid) above will not work because Tid, which is teacher id, has to be set valued, i.e. nested relation.

Object-Oriented Versus

Object-Relational

1. Objects and tuples

2. Extents and Relations

3. References and Object id’s

4. Type systems: similar for both. Us-

ing structure and collection type.

5. Abstract data type, information hid-

ing and methods: similar for both

6. Aggregation and Inheritance Hierar-

chy: Similar for both

7. instance variable/class variable

2. Inheritance:

create type student as

(sid varchar(10),

sname varchar(20),

saddress varchar(20))

create type GRE

(general number(3)

subject number(3))

create type GradStudent

under student

(gre GRE))

create table GradStudents of GradStudent

Object-Orientation in Query languages

(OQL)