Chapter 5 Object Oriented Database Systems
Chapter 5 Object Oriented Database Systems
Object Oriented
Database Systems
Chapter 5 - Objectives
Advanced database applications.
History of Database System
Weakness of RDBMSs for advanced database applications.
Object-oriented concepts.
Problems of storing objects in relational database.
Basics of object-oriented database analysis and design.
The next generation of database systems.
Brief Overview of OODBMS (ODL+OQL)
Brief Overview of ORDBMS (SQL/Object(SQL3), UDT ..etc
Message
Request from one object to another asking second
object to execute one of its methods.
Brief Overview
SELF.TRANSCRIPT */
END;
95 Object Oriented Database Systems 04/13/2024
Relationships( Cardinality)
Using the Ref keyword
<RefVariable> REF(referencedUDTType)
SCOPE <Referenced table>
One-to-many Or one-to-one
Plug it inside the existing types
Many-to-many
Create a new type or new table referencing
existing types with a scope indicating the
referenceable table
96 Object Oriented Database Systems 04/13/2024
Creating Tables Based on the UDTs
A UDT instance can persist only if it is stored as the
column value in a table.
For each UDT that is specified to be instantiable via the
phrase INSTANTIABLE, one or more tables may be
created.
Tables(views) can be Typed ( has “OF <Typename>”or
not Typed.
CREATE TABLE PERSON OF PERSON_TYPE
REF IS PERSON_ID SYSTEM GENERATED;
CREATE TABLE EMPLOYEE OF EMPLOYEE_TYPE
UNDER PERSON;
CREATE TABLE MANAGER OF MANAGER_TYPE UNDER
EMPLOYEE;
CREATE TABLE STUDENT OF STUDENT_TYPE UNDER
97 PERSON;
Object Oriented Database Systems 04/13/2024
Primary Key and Reference Attribute
This Query lists not only the details of rows that have
been explicitly inserted into the Person table, but also
the names from any rows that have been inserted into
any direct or indirect subtables of Person, in this case,
Staff and Client
But if you want objects only in the person table …???
106 Object Oriented Database Systems 04/13/2024
ORDBMS Query -Examples
Using the Only Phrase in the Where clause
SELECT p.lName, p.fName
FROM ONLY (Person) p
WHERE p.age > 65;
Use of the dereference operator(get the tuple
pointed to by the pointer(Ref attribute)
SQL uses a dot notation to build path expressions
that refer to the component attributes of tuples
and row types. However, for an attribute whose
type is REF, the dereferencing symbol (–>) is
used.
107 Object Oriented Database Systems 04/13/2024
dereference operator cont’d…
Find the name of the member of staff who manages
property ‘PG4’.