Adv DBMS-Unit 3
Adv DBMS-Unit 3
Unit - 3
1
Object-Based Databases
• Introduction to Object-Relational Database
• Complex Data Types
• Structured Data Types and Inheritance in SQL
• Table Inheritance
• Array
• Query Planning
• Evaluation and Optimization Techniques
Object-Relational Data Models
• Extend the relational data model by including object
orientation and constructs to deal with added data types.
• Allow attributes of tuples to have complex types,
including non-atomic values such as nested relations.
• Preserve relational foundations, in particular the
declarative access to data, while extending modeling
power.
• Upward compatibility with existing relational languages.
Complex Types and SQL
• Extensions introduced in SQL:1999 to support complex
types:
– Collection and large object types
• Nested relations are an example of collection types
– Structured types
• Nested record structures like composite attributes
– Inheritance
– Object orientation
• Including object identifiers and references
• Not fully implemented in any database system currently
– But some features are present in each of the major
commercial database systems
• Read the manual of your database system to see
what it supports
Structured Types and Inheritance in SQL
• Structured types (a.k.a. user-defined types) can be declared and
used in SQL
create type Name as
(firstname varchar(20),
lastname varchar(20))
final
create type Address as
(street varchar(20),
city varchar(20),
zipcode varchar(20))
not final
– Note: final and not final indicate whether subtypes can be created
• Structured types can be used to create tables with composite attributes
create table person (
name Name,
addressAddress,
dateOfBirth date)
• Dot notation used to reference components: name.firstname
Structured Types (cont.)
• Multisets
multiset [‘computer’, ‘database’, ‘SQL’]