www.cardiff.ac.uk/medic/irg-clinicalepidemiology
Objectrelational databases
Copyright By Assignmentchef assignmentchef
Information modelling
& database systems
in the previous lecture we learnt about advantages and disadvantages of objectoriented databases with respect to relational databases
in this lecture we will learn about a new type of databases objectrelational databases, which combine the features of relational databases with the best ideas of objectoriented databases
Objectrelational DBMS
ORDBMSs combine the features of RDBMSs with the best ideas of OODBMSs
they reuse the relational model as SQL interprets it
but new data types and functions can be implemented using programming languages such as Java
in other words, ORDBMSs allow developers to embed new classes of data objects into the relational data model
Enhanced table structure
an objectrelational database consists of tables
tables are made up of rows
all rows in a table are structurally identical
a fixed number of values of specific data types stored in columns
the most important distinction between traditional tables and object-relational tables is the way that ORDBMS columns are not limited to a standardised set of data types
relational version
CREATE TABLE Employees
FirstName VARCHAR(32) NOT NULL,
Surname VARCHAR(64) NOT NULL,
DOB DATE NOT NULL,
SalaryDECIMAL(10,2) NOT NULL
CHECK (Salary > 0.0),
Address_1 VARCHAR(64) NOT NULL,
Address_2 VARCHAR(64) NOT NULL,
CityVARCHAR(48) NOT NULL,
PostCodeVARCHAR(8)NOT NULL,
PRIMARY KEY (Surname, FirstName, DOB)
objectrelational version
CREATE TABLE Employees
NamePersonNameNOT NULL,
DOB DATENOT NULL,
SalaryCurrencyNOT NULL,
Address StreetAddress NOT NULL,
PRIMARY KEY (Name, DOB)
these types correspond to class names, which are software modules
they encapsulate state as well as behaviour
Objectrelational data model
objectrelational data model amounts to objects in a relational framework
object types can be defined using CREATE TYPE AS OBJECT statement
a flexible framework for organising and manipulating software objects corresponding to realworld phenomena
but ORDBMSs offer more than just object data types
ORDB schema has additional features not present in relational schema
e.g. inheritance and polymorphism are part of the objectrelational data model
Polymorphism is the provision of a single interface to entities of different types or the use of a single symbol to represent multiple different types.
Objectrelational data model
an objectrelational table can contain exotic data types
in addition, objectrelational tables can be organised into new kinds of relationships
tables can be typed, developers can create a table with a record structure that corresponds to the definition of a data type
the type system includes a notion of inheritance in which data types can be organised into hierarchies
this naturally supplies a mechanism whereby tables can be arranged into hierarchies too
Inheritance
in most OO models, the concept of inheritance is limited to the structure & behaviour of classes
in an object-relational database, queries can address data values throughout the hierarchy
an objectrelational SQL statement that addresses a table can address the records in all subtables
Collections
in relational databases, columns can contain at most one data value
this is called the first normal form constraint
when a group of values need to be combined into a single data object, a separate table needs to be created to store the group
in an objectrelational databases such groups can be stored in rows using collections, which can contain multiple data values
to define a collection type, use the CREATE TYPE . . . AS TABLE OF statement
Query language
data stored in an ORDBMS can be manipulated using an extended version of the SQL, which is a declarative language
SQL:1999 (SQL 3) started supporting objectrelational features
SQL:2003 subsequently clarified these features
SQL:2019 is the latest revision of the standard
SQL is still a declarative relational language
declarative: SQL statements describe what it is wanted, rather than a procedural, step-by-step algorithm defining how to accomplish the task
relational: SQL expresses operations over relational schema elements such as tables & views
Advantages
performance higher levels of data throughput, i.e. better response times than RDBMSs
flexibility integrating functional aspects with the structural ones improves the of the overall system
maintainability flexibility reduces the costs associated with system development and ongoing maintenance
all major database vendors have upgraded their relational database products to objectrelational database management systems to reflect the new SQL standards
https://docs.oracle.com/cd/B28359_01/appdev.111/b28371/adobjint.htm#CHDIBIIA
/docProps/thumbnail.jpeg
CS: assignmentchef QQ: 1823890830 Email: [email protected]
Reviews
There are no reviews yet.