Showing posts with label Object Databases. Show all posts
Showing posts with label Object Databases. Show all posts

Friday, April 21, 2017

Collection Types in Object database systems

Collection types in object relational database systems, Collection types VARRAY, Nested Tables, and Associative Arrays in Oracle


Collection Types

A collection is an ordered group of elements of same type. The purpose of collection type is to support multiple values for one attribute [variable]. For example, other programming languages support the collection types array, lists, sets, bags, trees etc. To extend these features in database applications, PL/SQL provides the following collection types;


  • Associative Arrays

***************


Thursday, November 20, 2014

ORDBMS Structured Types



Define Structured Types / Overview of Structured Types / What is Abstract Datatype? / How to define Structured types or Abstract datatypes? / Structured type (Abstract datatype) definition in Oracle with example.


Structured Types

The major advantage of using objects is the ability to define new data types (Abstract Data Types). In ORDBMS, the RDBMS extends the usage of objects that can be defined and stored as part of database. Like a CLASS declaration in C++ language, a new type can be defined in an ORDBMS as follows; (the reserved words/keywords are given in UPPERCASE hereafter)

CREATE TYPE type_name AS
(Attribute1_name data_type(size),
Attribute2_name data_type(size),
Attribute3_name data_type(size),
…….
AttributeN_name data+_type(size));

Here, data_type can be any of the following;

  • It can be one of the valid data types like CHAR, VARCHAR, NUMBER, INTEGER, etc. Or
  • It can be another User Defined Type.

We call this kind of new User Defined Types as Structured Types / Abstract Datatypes.

For example, Structured types can be declared and used in SQL:1999 as follows;
CREATE TYPE phone AS
(Country_code NUMBER(4),
STD_Code NUMBER(5),
Phone_Number NUMBER(10))

This type can be used in other TYPE definition or TABLE definition as follows;
CREATE TABLE contact
(Contact_name VARCHAR(25),
Street VARCHAR(25),
City VARCHAR(25),
Ph PHONE);

In this TABLE definition, PHONE is the structured type that we have defined through previous example.

Structured Types in Oracle

Let us see some examples of defining and manipulating Structured types in Oracle.

CREATE TYPE Address AS OBJECT
(Street VARCHAR(35),
City VARCHAR(30),
State VARCHAR(30),
Pincode NUMBER(10));
Execution of the above statement will create a new ABSTRACT datatype named ADDRESS and store the definition as part of the database.
This new type can be used to define an attribute in any TABLEs or TYPEs as follows;

CREATE TABLE Person
(Person_name VARCHAR(25),
Addr ADDRESS,
Phone NUMBER(10));

This table Person will consist of 3 columns where the first one and the third one are of regular datatypes VARCHAR, and NUMBER respectively, and the second one is of the abstract type ADDRESS. The table PERSON will look like as follows;

Person_name
Addr
Phone
Street
City
State
Pincode






Table 1 – Person table


Monday, November 10, 2014

Major Features of Object Relational DBMS (ORDBMS)

List the major features of ORDBMS / What are the important features of ORDBMS? / Apart from features of RDBMS, what are the other Object oriented features supported by ORDBMS?




Major Features of ORDBMS


  • User-defined abstract data types (ADTs) - ADTs allow new data types with structures suited to particular applications to be defined.

  • User-defined routines – these provide the means for writing customized server functions that have much of the power and functionality expressible in C.

  • Inheritance - inheritance of user defined types is supported to derive new sub-types or sub-classes which would therefore inherit all attributes and methods from the parent type.

  • Encapsulation - encapsulation is a language mechanism for restricting access to some of the object's components.

  • Complex objects including first normal form objects.

  • Object Identity – OIDs are used to identify objects.

  • Large objects support - these are disk-based objects that have the functionality of random access files. ADTs use them to store any data that does not fit into a table row.

  • Extensible and flexible indexing - R-tree or Generalized Search Tree (GiST) indexing for multi-dimensional data enables fast searching of particular ADTs in a table.


Disadvantages of ORDBMS

List the disadvantages of ORDBMS / What are the disadvantages of ORDBMS?



Disadvantages of ORDBMSs

  • Complexity

  • Increased cost

  • Unclear if the ORDBMS will actually combine relationships and encapsulated objects to correctly and completely mirror the ‘real world’.


Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery