Download as pdf or txt
Download as pdf or txt
You are on page 1of 46

LO1 : The practical and theoretical aspects of

advanced topics in databases, such as Object


relational databases, data warehouses and
distributed databases.
Database is a systematic
collection of data.
-Databases support storage
and manipulation of data.

-Databases make data management easy.


Database System
Components of 1. Hardware
2. Software
a Database a. DBMS
System b. Application Software
3. People
a. Users
b. Practitioners
4. Data
Physical View
The DBMS must know
– exact physical location
– precise physical structure
Database

EMPLOYEE DETAILS
File
• A collection of data records with similar
characteristics
• Student list, course list at the university
• price list, stock records at a supermarket

Item# Description Shelf# Max Stock Reorder Balance


1152 Milk D01 100 25 70
1167 Bread D01 70 25 30
1175 Sugar G02 300 50 120
1172 Rice G04 50 20 35
Physical Design
• Provide good
performance
– Fast response time
– Minimum disk accesses
Data Block

• A data block (sector) is the smallest unit of


data defined within the database.
• block size may be defined by the
DB_BLOCK_SIZE
Definitions
• Seek time
– Average time to move the read-write head to
the correct cylinder
• Rotational delay
– Average time for the sector to move under the
read-write head
• Transfer time
– Time to read a sector and transfer the data to
Memory
• Logical Record
– The data about an entity (a row in a table)
• Physical Record
– A sector, page or block on the storage
medium
• Typically several logical records can be
stored in one physical record.
Object Relational Database
An object-relational database (ORD) is a database management
system (DBMS) that's composed of both a relational database
(RDBMS) and an object-oriented database (OODBMS).

- ORD supports the basic components of any object-oriented


database model in its schemas and the query language used, such
as objects, classes and inheritance.
- An object-relational database may also be known as an object
relational database management systems (ORDBMS).
Advantages :

-The Object Relational data model allows its users to inherit objects, tables
etc. Inherited objects contains new attributes as well as the attributes that
were inherited.
-Complex data types can be formed using existing data types. This is useful
in Object relational data model as complex data types allow better
manipulation of the data.
-The functionality of the system can be extended in Object relational data
model. This can be achieved using complex data types as well as advanced
concepts of object oriented model such as inheritance.
Disadvantages :

The ORDBMS approach has the obvious disadvantages of complexity


and associated increased costs.
Some of the Object Relational Database Management Systems
are:
– Oracle 8
– Postgresql
– Informix Universal Server

• In addition, we will discuss SQL 3 language latest version of


SQL language which extends SQL 2 by incorporating object
database and other features such as extended data types
SQL 3
– SQL3 object facilities primarily involve extensions to SQL's
type facilities; however, extensions to SQL table facilities can
also be considered relevant.

Additional facilities include control structures to make SQL a


computationally complete language for creating, managing,
and querying persistent object-like data structures.
SQL 3……………..
The parts of SQL3 that provide the primary basis for supporting
object-oriented structures are:
– user-defined types (ADTs, named row types, and distinct
types)
– type constructors for row types and reference types
– type constructors for collection types (sets, lists, and
multi sets)
– user-defined functions and procedures
– support for large objects (BLOBs and CLOBs)
SQL 3……………..

A row type is a sequence of field name/data type pairs


resembling a table definition. Two rows are type-equivalent if
both have the same number of fields and every pair of fields in
the same position have compatible types. The row type
provides a data type that can represent the types of rows in
tables, so that complete rows can be stored.
SQL 3……………..

• Operations that may be invoked in SQL include defined operations on tables


(SELECT, INSERT, UPDATE, DELETE), the implicitly defined functions defined for
ADT attributes, and routines either explicitly associated with ADTs or defined
separately.
• Routines associated with ADTs are FUNCTION definitions for type-specific user-
defined behavior. The FUNCTION definitions specify the operations on the ADT and
return a single value of a defined data type. Functions may either be SQL functions,
completely defined in an SQL schema definition, or external functions, defined in
standard programming languages.
SQL 3……………..
• QL functions associated with ADTs are invoked using either a functional notation
or a dot notation (the dot notation, double dot notation, is syntactic sugar for the
functional notation).
• Different routines may have the same name.
• This is referred to as overloading, and may be required, for example, to allow and
ADT subtype to redefine an operation inherited from a super type.

• SQL3 implements what is sometimes known as a generalized object model,


meaning that the types of all arguments of a routine are taken into consideration
when determining what routine to invoke, rather than using only a single type
specified in the invocation as, for example, in C++ or Smalltalk
SQL 3……………..
• Inheritance
– An ADT can be defined as a subtype of one or more ADTs by defining it as UNDER
those ADTs (multiple inheritance is supported). In this case, the ADT is referred to as
a direct subtype of the ADTs specified in the UNDER clause, and these ADTs are
direct supertypes.
– A type can have more than one subtype and more than one supertype. A subtype
inherits all the attributes and behavior of its supertypes; additional attributes and
behavior can also be defined. An instance of a subtype is considered an instance of
all of its supertypes. An instance of a subtype can be used wherever an instance of
any of its supertypes is expected.
• CREATE TABLE person (name
CHAR(20), sex CHAR(1), age INTEGER);

• CREATE TABLE employee UNDER


person (salary FLOAT);

• CREATE TABLE customer UNDER


person (account INTEGER)
The number of other statements which are added:
– An assignment statement that allows the result of an
SQL value expression to be assigned to a free
standing local variable, a column, or an attributeof an
ADT.
– A CALL statement that allows invocation of an SQL
procedure.
– A RETURN statement that allows the result of an SQL
value expressionto be returned as the RETURNS
value of the SQL function.
The number of other statements which are added:
– An assignment statement that allows the result of an
SQL value expression to be assigned to a free
standing local variable, a column, or an attributeof an
ADT.
– A CALL statement that allows invocation of an SQL
procedure.
– A RETURN statement that allows the result of an SQL
value expression to be returned as the RETURNS
value of the SQL function.
– A CASE statement to allow selection of an execution
path based on alternative choices.

– An IF statement with THEN, ELSE, and ELSEIF alternatives to allow


selection of an execution path based on the truth value of one or more
conditions.

– Statements for LOOP, WHILE, and REPEAT to allow repeated execution


of a block of SQL statements. WHILE checks a <search condition> before
execution of the block, and REPEAT checks it afterwards. All three
statements are allowed to have a statement label.
• CentralizedDBMS all system components
(data, DBMS software and secondary
Centralized storage devices) reside at a single
computer or site.
Databases • A centralized database can be accessed
remotely via terminals connected to the
site.
Distributed
Databases
• A distributed database is a database that consists of two or more
files located in different sites either on the same network or on
entirely different networks.

• Data spread across several databases connected through


telecommunications devices.
• The user does not need to have knowledge about the physical
location of the database.
• DBMS finds the location of data according to the user requirement
Distribution

• Deals with Physical distribution of data over multiple sites


• Three alternative architectures available
– Client-Server, communication duties are shared between the client
machines and servers.
– Peer-to-peer systems, no distinction of client machines versus servers.
Integrate all local schemas.
– Non-distributed systems. Integrate some local schema.
Types of DDBMS
Homogeneous DDBMS - Homogeneous DDBMSs are software to
integrate DBMSs geographically distributed over network; all
DBMSs have same data model/query language; hardware is same
manufacturer/operating system (server & user). uses one DBMS
(e.g.: MS-SQL or Oracle)
Advantages :

• reflecting distributed nature of some database applications


Many database applications are naturally distributed over some different locations
(e.g. a company may have locations in different cities)

• increased reliability and availability


When a centralised system fails, the database is unavailable to all users. A distributed
system however will continue to function at some reduced level even when a component
fails.

• local control
Data distribution in a distributed database encourages local groups to exercise
greater control over "their" data. This promotes improved data integrity and
administration. At the same time, users can still access non-local data when necessary.
• lower communication costs
With a distributed system data can be located closer to the point of use. This can reduce
communication costs when compared to a centralised system.

• fast response and improved performance


-By distributing a large database over multiple sites, smaller databases exist at each site. Some
user queries at a particular site may only need to access their smaller database stored locally.
This speeds up query processing and enhances database performance.
-It may also he possible to decompose complex queries into sub-queries that can be processed
in parallel at several different sites.

• interconnection of existing databases


When several databases already exist in an organisation and the necessity of performing global
applications arises, the distributed database often offers a natural solution by integrating and
interconnecting the pre-existing local databases.
Disadvantages :

• Software cost and complexity


-This is far greater for distributed environment than for a centralised system.

• Communication/Processing overheads
-These are much greater because the various sites must exchange messages and perform
additional calculations to ensure proper co-ordination among the sites. There is always the risk that the
communication overhead may degrade system responsiveness and performance.

• Data Integrity and consistency


Given the increased complexity of the system and the need for co-ordination from multiple
sites, additional control mechanisms are required in order to prevent improper updating of data and
avoid other problems of data integrity/consistency.
Data
warehouses
• Data warehouse is a collection of large historical data
• Stores data that have been extracted from the various operational,
external and other databases
• A central source of the data that have been cleaned, transformed,
catalogued
• Can use for data mining, online analytical processing ,market
research and decision support
• A database for historical data
Benefits :

A data warehouse provides a single source of data for all decision


support activities.
Through identification of patterns, trends etc. Management can
make more effective business decisions which in turn will gain
competitive advantage.
• A departmentalized structure of data
feeding from the Data Warehouse
where data is denormalized based on
the department’s need for
information.
Data Marts • Data marts are generally small data
warehouses and uses the same
structures and many of the same
development methods as data
warehouses.
• The difference is they are intend to
meet a specific need or to deliver
only one type of information.
END OF THE SESSION…..

You might also like