Professional Documents
Culture Documents
Carnegie Mellon
Detailed outline
OO DBMSs OR DBMS
complex data types inheritance UDFs
Carnegie Mellon
15-415 - C. Faloutsos
Their specs?
complex objects (sets/vectors) inheritance new data types (image, video, ...) and user defined functions (UDFs)
Carnegie Mellon
15-415 - C. Faloutsos
Two solutions:
Object Oriented DBMSs Object Relational DBMSs
Carnegie Mellon
15-415 - C. Faloutsos
OO DBMS
roughly, C++ with persistence commercial systems:
O2; ObjectStore; Objectivity
ODMG: defined standards BUT: OODBMS have small market share Hence: OR-DBMSs
Carnegie Mellon 15-415 - C. Faloutsos 9
OR DBMSs
traditional DBMS with attempts to provide user defined data types support for large / complex objects inheritance
Carnegie Mellon
15-415 - C. Faloutsos
10
Carnegie Mellon
15-415 - C. Faloutsos
11
Complex types
eg, create type MyDate ( day decimal(2), month char(3), year decimal (4) );
Carnegie Mellon 15-415 - C. Faloutsos 12
Complex types
eg, Row Types: create row type Doc ( callnum varchar2(10), title char(20), authors list (varchar2(20)) ); create table document of type Doc;
Carnegie Mellon 15-415 - C. Faloutsos 13
Complex types
DML - insertions: insert into document values (QA123.45, DB systems, set(Smith, Johnson) );
Carnegie Mellon
15-415 - C. Faloutsos
14
Inheritance
single inheritance: create type Person ( ssn varchar2(10), name char(20)); create type Student (major varchar2(5)) under Person;
Carnegie Mellon 15-415 - C. Faloutsos 15
Inheritance
multiple inheritance: create type Teacher ( salary integer) under Person; create type TA under Student, Teacher;
Carnegie Mellon
15-415 - C. Faloutsos
16
Inheritance
multiple inheritance: constraints: one TA record corresponds to exactly one Teacher and Student record insertions/deletions/updates: appropriately propagated.
Carnegie Mellon 15-415 - C. Faloutsos 17
Carnegie Mellon
15-415 - C. Faloutsos
18
(recall:) create row type Doc ( callnum varchar2(10), title char(20), authors list (varchar2(20)) ); create table document of type Doc;
Carnegie Mellon 15-415 - C. Faloutsos 19
Carnegie Mellon
15-415 - C. Faloutsos
20
Carnegie Mellon
15-415 - C. Faloutsos
21
UDFs
create function author-count (adoc document) returns integer as select count (authors) from adoc; select title from document d where author-count(d) > 1
Carnegie Mellon 15-415 - C. Faloutsos 22
UDFs
UDFs: stay within the DBMS, for everybody to use!
Carnegie Mellon
15-415 - C. Faloutsos
23
Detailed outline
OO DBMSs OR DBMS
complex data types inheritance UDFs
ORACLE-specific
Large objects PL/SQL and UDFs
Carnegie Mellon
15-415 - C. Faloutsos
25
ORACLE-specific
Large objects, eg., video, images, 3d-MRI scans new data types:
Carnegie Mellon
15-415 - C. Faloutsos
26
ORACLE-specific
Large objects, eg., video, images, 3d-MRI scans new data types: LOB (=Large OBject)
BLOB: (up to 4Gb; binary: jpeg, mpeg, ...) CLOB: (up to 2Gb; character: english text) NCLOB:(..............; multi-byte characters) (LONG: similar, for backwards compatibility)
Carnegie Mellon 15-415 - C. Faloutsos 27
ORACLE-specific
stored procedures PL/SQL: a C-like language
too large to describe here (see book on reserve) example of a stored procedure:
Carnegie Mellon
15-415 - C. Faloutsos
28
ORACLE-specific
SQL> create or replace procedure del-st-rec (s-id number) as begin delete from student where s-id = ssn; end del-st-rec; SQL> execute del-st-rec ( 123 );
Carnegie Mellon 15-415 - C. Faloutsos 29
Detailed outline
OO DBMSs OR DBMS
complex data types inheritance UDFs
Conclusions
OO and OR DBMS strive for
complex data types inheritance UDFs
Carnegie Mellon
15-415 - C. Faloutsos
31
Conclusions
OR DBMSs: overwhelming market share (why?)
SQL is more standardized than OO query languages legacy data are in SQL more SQL programmers are available
Carnegie Mellon
15-415 - C. Faloutsos
32