You are on page 1of 16

SUBJECT CODE

TYPE THE SUBJECT NAME HERE

UNIT NO 5
ADVANCED TOPICS

5.2 Object based Databases: Object


II IV Database Concepts, Object Relational
Features
CS8492
DATABASE MANAGEMENT SYSTEMS
(Common to CSE & IT)
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

insert into 'Advanced_Database_Course’


('Title','Author') values(

Object-Based Databases‘,
‘Farzad Nozarian‘);

2
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

Summary
1 Overview

2 Complex Data Types

3 Structured Types and Inheritance in SQL

3.1 Structured Types

3.2 Type Inheritance


3
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

4 Table Inheritance

5 Array and Multiset Types in SQL

5.1 Creating and Accessing Collection


Values

5.2 Querying Collection-Valued


Attributes

5.3 Nesting and Unnesting


4
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

• Overview
Obstacles using the relational data model

• limited type system support

• difficulty in accessing database data from in C++ or Java

Object-relational data model

• richer type system including complex data types and object orientation

Object-relational database systems

• migrate for users who wish to use object-oriented features

5
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

Object-Oriented Database
Object-Oriented System
DBMS
complex objects encapsulation
Persistence

Storage object identity class hierarchy


management +
extensibility
Concurrency types & classes

Recovery Computational overriding &


completeness overloading
Querying
6
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

• Complex Data Types

Example1 : addresses

Atomic data item of type string

A better alternative structured data types (street, address, city, state, postal code)

Example 2: phone numbers Using normalization ?!

The alternative of normalization by creating a

new relation is expensive and artificial for this example.

7
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

• Complex Data Types

A library application

Several domains will be non-atomic

satisfies 4NF
8
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

• Complex Data Types

The typical user or programmer of an information-retrieval system thinks of the database in terms

of books having sets of authors, as the non-1NF design models.

The 4NF design requires queries to join multiple relations, whereas the non-1NF design makes

many types of queries easier.

9
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

• Structured Types and Inheritance in SQL

Structured Types
Allow composite attributes of E-R designs to be represented directly

create type Name as (firstname


varchar(20), lastname varchar(20))
final;

create type Address as(street varchar(20),


city varchar(20), zipcode
varchar(9)) not final;

10
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

• Structured Types and Inheritance in SQL

Structured Types

We can now use these types to create composite attributes in a relation

create table person( name Name,


address Address,
dateOfBirth date);

The components of a composite attribute can be accessed using a “dot” notation

11
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

• Structured Types and Inheritance in SQL


Type Inheritance

create type Person


(name varchar(20),
address varchar(20));

create type Student create type Teacher


under Person under Person
(degree varchar(20), (salary
department varchar(20)); integer,
department varchar(20));
12
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

•Structured Types and Inheritance in SQL


Type Inheritance

Methods of a structured type are inherited by its


subtypes using overriding method

The keyword final says that subtypes may not be


created from the given type
not final says that subtypes may be created.

Can you create a TeachingAssistant type ? Yes !

create type TeachingAssistant


under Student, Teacher;
13
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

• Table Inheritance

Subtables in SQL correspond to the E-R notion of specialization/generalization.

create table people of Person;

create table students of Student under create table teachers of Teacher under
people; people;

14
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

https://youtu.be/us8MRXcA240

https://youtu.be/cw9NmtqZPzg

http://tiny.cc/
https://youtu.be/fyTMM1_KP9o

15
CS8492
DATABASE MANAGEMENT SYSTEMS (Common to CSE & IT)

16

You might also like