0% found this document useful (0 votes)
164 views18 pages

The Data Model

The document discusses different data models including hierarchical, network, relational, object-oriented, and object-relational models. It provides details on the structure and advantages and disadvantages of each model. The relational model represents data as tables with rows and columns and is widely used. The object-oriented model was introduced to overcome shortcomings of other models by defining objects and relationships. The object-relational model combines features of relational and object-oriented models.

Uploaded by

Mohamed Shaam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
164 views18 pages

The Data Model

The document discusses different data models including hierarchical, network, relational, object-oriented, and object-relational models. It provides details on the structure and advantages and disadvantages of each model. The relational model represents data as tables with rows and columns and is widely used. The object-oriented model was introduced to overcome shortcomings of other models by defining objects and relationships. The object-relational model combines features of relational and object-oriented models.

Uploaded by

Mohamed Shaam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 18

Faculty of Engineering, Science and Technology

Department of Computer Science

CPT211 Database Systems


CPT147 Database Management Systems

LECTURE 3
THE DATA MODEL
What is a Data Model?

 The basic structure of the database


that organizes data, defines how
the data are stored and accessed,
and the relationships between the
data, is the data model.
Data Model

 The database designer usually employs data models as


communications tools to facilitate the interaction among
the designer, the applications programmer, and the end
user.
 A good database is the foundation for good applications.
 A data model is a plan for building a database.

 The Entity-Relation Model (ER) is the most common


method used to build data models.
 The data model focuses on what data should be
stored in the database.
 The information needed to build a data model is
gathered during the requirements analysis.
Why is data modeling important?

 The goal of the data model is to make sure that the all
data objects required by the database are completely
and accurately represented.

 The data model is also detailed enough to be used by


the database developers to use as a "blueprint" for
building the physical database.
Types of Data models
The evolution of data models

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.

 It can handle one to many (1:n) and many to


many (n: n) relationships
 The changes in data characteristics do not
require changes to the application programs.
 The data access is easier and flexible than the
hierarchical model.

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.

Student Table Course Table


Student_ID Student_Name Course_ID Course_Name
101 Ailish 14 Python
102 Luyoona 16 Android

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

 It is designed to provide a relational database


management that allows developers to integrate
databases with their data types and methods.
 It is essentially a relational model that allows
users to integrate object-oriented features into it.
 Object relational model combine advantages of
both modern object oriented programming
languages with relational database features such
as multiple views of data and high level non
procedural query language.
 Some of these systems available In market are IBM’s DB2 universal server,
oracle corporations oracle 8, Microsoft Corporations SQL server 7 and so on.
Advantages
 It allows users to define new data types that combine
one or more of the currently existing data types.
Complex types aid in better flexibility in organizing the
data on a structure made up of columns and tables.
 Users are able to extend the capability of the database
server.
 this can be done by defining new data types, as well as user-
defined patterns. This allows the user to store and manage
data.

Disadvantages
 Storage structures and access methods become quite
complex.
 Issues related to indexing on user defined types are
experienced.

You might also like