The Data Model
The Data Model
LECTURE 3
THE DATA MODEL
What is a Data Model?
The goal of the data model is to make sure that the all
data objects required by the database are completely
and accurately represented.
Hierarchical
Network
Relational
Object Oriented
Hierarchical model
This is the oldest form of database.
Data elements are linked as an inverted
tree structure (root at the top with
branches formed below).
Below the single root data element are
subordinate elements each of which in
turn has its own subordinate elements
and so on, the tree can grow to multiple
levels.
Data elements has parent child
relationship as in a family tree.
Use one– to–many relationship
Advantages
A very efficient model, when the database contains a large
number of 1: n relationships and when the users require large
number of transactions, using data whose relationships are
fixed.
It is the first database model that offered the data security
that is provided and enforced by DBMS.
Disadvantages
It is conceptually simple and easy to design ,but it is quite
complex to implement.
The link is permanently established and cannot be modified
which makes this model rigid.
If you make any changes in the database structure, then you
need to make the necessary changes in all the application
programs that access the database.
Network model
This model is the extension of hierarchical data model.
It has a parent child relationship but a child data element can
have more than one parent element or no parent at all.
The main difference of the network model from the
hierarchical model is its ability to handle many –to – many (n:
n) relationships or in other words it allows a record to have
more than one parent.
Advantages
It is conceptually simple and easy to design.
Disadvantages
It can be quite complicated to maintain all the
links.
Detailed structural knowledge is required.
There is lack of structural independence.
The insertion, deletion and updating
operations of any record require large number
of pointers adjustments.
Relational Model
The relational database was invented by E. F. Codd at IBM in
1970.
The relational model represents data and relationships
among data by a collection of tables called relations, each of
which has a number of columns represented as attributes
(field) with unique names and each row of the relational table
is called as tuple.
Each row in a relational table must have a unique primary
key.
Relational data model is used widely around the world for
data storage and processing.
This model is simple and it has all the properties and
capabilities required to process data with storage efficiency.
Example of Relational Model
COLLEGE table has Batch_Year as primary key.
Student_ID and Course_ID are the foreign Key in the College Table.
These keys serve as primary keys for STUDENT and COURSE tables.
College Table
Batch_Year Student_ID Course_ID Lecturer Contact
2012-16 101 14 Ahmed 9875642
2013-17 102 16 Aisha 7985412
Advantages
Data as tables consisting of rows and columns is much easier to understand.
Structural independence - Changes in the database structure do not affect the data
access.
The relational database model achieves both data independence and
structural independence making the database design, maintenance, administration
and usage much easier than the other models.
It is simpler to navigate.
It facilitates multiple views of the same database for different users.
Disadvantages
Machine performance
If the number of tables between which relationships to be established are large and the
tables themselves, effect the performance in responding to the SQL queries.
Slower processing times than hierarchical and network models.
Object Oriented Model
Object oriented models were
introduced to overcome the
shortcomings of conventional
models like Relational,
Hierarchical and network model.
An object oriented database is
collection of objects whose
behavior, state, and relationships
are defined in accordance with
object oriented concepts (such
as objects, class, class hierarchy
etc. )
Users can define own data
access methods, the
representation of data and the
method of manipulating it.
Example:
Class vehicle is root of a class composition hierarchy including classes VehicleSpecs,
Company and Employee.
Class Vehicle is also root of a class Hierarchy involving classes Two Wheeler and
FourWheeler.
Class Company is in turn, root of a class hierarchy with subclasses Domestic Company and
Foreign Company.
Class Company is also root of a class composition hierarchy involving class Employee.
Example:
The class population is the root of class hierarchy, which includes the
Nation class.
The Population class is also the root of two sub-class, men and women.
The Nation class is the root of other sub-classes country1, country2,
country3.
Note that each class has its own set of attributes apart from the root class's
attributes.
Advantages
Data access is easy.
It provides higher performance management of objects and
complex interrelationships between objects.
Unlike traditional databases (such as hierarchical, network or
relational), the object oriented database are capable of
storing different types of data, for example, pictures, voice
video, including text, numbers and so on.
Disadvantages
There is no universally agreed data model for an OODBMS,
and most models lack a theoretical foundation.
The increased functionality provided by the OODBMS makes
the system more complex than that of traditional DBMSs.
Object relational model
Disadvantages
Storage structures and access methods become quite
complex.
Issues related to indexing on user defined types are
experienced.