Object-Based Databases - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Object-Based Databases

Description:

Object-Based Databases Jose Reyes Jose Overview Object-relational data model extends the relational data model by providing a richer type system including complex ... – PowerPoint PPT presentation

Number of Views:177
Avg rating:3.0/5.0
Slides: 16
Provided by: Jayj151
Category:

less

Transcript and Presenter's Notes

Title: Object-Based Databases


1
Object-Based Databases
  • Jose Reyes Jose

2
Overview
  • Object-relational data model extends the
    relational data model by providing a richer type
    system including complex data types and object
    orientation
  • Database systems based on the object-relation
    model provide a convenient migration path for
    users of relational databases who wish to use
    object-oriented features

3
Complex Data Types
  • Book title
  • List of authors
  • Publisher
  • Set of keywords

4
4NF Decomposition
5
Nested Relation
6
Structured Types
Create type Address as (street varchar(20),
city varchar(20), zipcode
varchar(20)) not final
Create type Name as (firstname varchar(20),
lastname varchar(20)) final
Note final and not final indicate where
subtypes can be created
7
Structured Types cont
Create table customer( name Name, address
Address, dateOfBirth date)
8
Create type CustomerType as ( name Name,
address Address, dateOfBirth date) not
final Create table customer of CustomerType
Create table customer( name row (firstname
varchar(20), lastname
varchar(20)) address row (street varchar(20),
city varchar(20),
zipcode varchar(9)),
dateOfBirth date)
9
Select name.lastname, address.city From customer
10

We add a method to a structured type definition
create type CustomerType as ( name
Name, address Address, dateOnBirth
date) not final method
ageOnDate(onDate date) returns interval
year
We create the method body separately create
instance method ageOnDate(onDate date)
returns interval year for CustomerType
begin return onDate --
self.dateOfBirth end
11
Select name.lastname, ageOnDate(current_date) From
customer
12
create function Name(firstname varchar(20),
lastname varchar(20)) returns Name begin set
self.firstname firstname set self.lastname
lastname end
insert into Customer values (new
Name(John, Smith), new Address(20
Main St, New York, 11001), date
1960-8-22)
13
Inheritance
create type Student under Person (degree
varchar(20), department varchar(20)) create
type Teacher under Person (salary integer,
department varchar(20))
create type Person (name varchar(20),
address varchar(20))
create type TeachingAssistant under Student
with (department as student_dept),
Teacher with (department as teacher_dept)
14
Conclusion
  • object based database simplify complex data types
  • the SQL for structuring these data types
  • the SQL for methods and inheritance

15
References
  • http//highered.mcgraw-hill.com/sites/0072958863/
  • Database System Concepts 5th edition
Write a Comment
User Comments (0)
About PowerShow.com