Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 22

Data Model

Definition

A database model or simply a data model is an abstract


model that describes how the data is represented and
used. A data model consists of a set of data structures
and conceptual tools that is used to describe the
structure (data types, relationships, and constraints)
of a database.
Depending on the concept they use to model the
structure of the database, the data models are
categorized into three types, namely,
1. High-level or conceptual data models
2. Representational or implementation data models
3. Low-level or physical data models.
Conceptual Data Model

• Conceptual data model describes the information


used by an organization in a way that is
independent of any implementation-level issues
and details.
• The main advantage of conceptual data model is
that it is independent of implementation details and
hence, can be understood even by the end users
having non-technical background.
• The most popular conceptual data model, that is,
entity-relationship (E-R) model
Representational Data Model

The representational or implementation data


models can be implemented directly on a
computer system. Representational data
models are used most frequently in all
traditional commercial DBMSs. The various
representational data models are discussed
here.
1. Hierarchical Data Model
2. Network Data Model
3. Relational Data Model
Hierarchical Data Model

• The hierarchical data model is the oldest type of data


model, developed by IBM in 1968.
• This data model organizes the data in a tree-like
structure, in which each child node (also known as
dependents) can have only one parent node.
• The database based on the hierarchical data model
comprises a set of records connected to one another
through links. The link is an association between two
or more records.
• The top of the tree structure consists of a single node
that does not have any parent and is called the root
node.
Hierarchical Data Model

• The root may have any number of dependents;


each of these dependents may have any number of
lower level dependents. Each child node can have
only one parent node and a parent node can have
any number of (many) child nodes.
• It, therefore, represents only one-to-one and one-
to-many relationships.
• Hierarchical DBMSs were popular from the late
1960s, with the introduction of IBM's Information
Management System (IMS) DBMS, through the
1970s.
Hierarchical Data Model
Example of Hierarchical Data Model
It shows a database of Customer-Loan, here a customer can
take multiple loans and there is also a provision of joint
loan where more than one person can take a joint loan. As
shown, CI customer takes a single loan Ll of amount 10000
jointly with customer C2. Customer C3 takes two loans L2 of
amount 15000 and L3 of amount 25000.
Network Data Model
• The first specification of network data model was presented by
Conference on Data Systems Languages (CODASYL) in 1969,
followed by the second specification in 1971.
• It is powerful but complicated. In a network model the data is
also represented by a collection of records, and relationships
among data are represented by links.
• The main difference between hierarchical and network data
model is that in hierarchical data model, the data is organized in
the form of trees and in network data model, the data is
organized in the form of graphs.
• The main advantage of network data model is that a parent node
can have many child nodes and a child can also have many
parent nodes. Thus, the network model permits the modeling of
many-to-many relationships in data.
• IDMS(Integrated Data Management Store) was the most popular
network DBMS.
Relational Data Model

• The relational data model was developed by E. F. Codd in


1970.
• In the relational data model, unlike the hierarchical and
network models, there are no physical links.
• All data is maintained in the form of tables (generally, known
as relations) consisting of rows and columns. Each row
(record) represents an entity and a column (field) represents
an attribute of the entity.
• The relationship between the two tables is implemented
through a common attribute in the tables and not by
physical links or pointers.
• Oracle, Sybase, DB2, Ingres, Informix, MS-SQL Server are few
of the popular relational DBMSs.
E. F. Codd
Our Hero

13
Relational data model for Online Book database
Properties of Relational Tables

• Values Are Atomic


• Each Row is Unique
• Column Values Are of the Same Kind
• The Sequence of Columns is Insignificant
• The Sequence of Rows is Insignificant Each
Column Has a Unique Name
DBMS Vs RDBMS
DBMS RDBMS
Relationship between two files or tables Relationship between two tables or files
maintain programmatically can be specified at the time of table
creation

Does not support client/server architecture Supports client/server architecture


Does not support Distributed database Supports Distributed Databases
No security of Data Multilevel security
1. Logging in at OS level
2. Command level
3. Object level

DBMS may satisfy less than 7 or 8 rules of 1. RDBMS usually satisfy more than 7 or 8
E.F. Codd rules of E.F. Codd

Relation between tables is physical Relation between tables logical

DBMS does not support Data Integrity RDBMS supports Data Integrity
Database Schema versus Database Instance

The overall design or description of the


database is known as database schema or
simply schema. The database schema is also
known as intension of the database, and is
specified while designing the database.
Database Instance

Database Instance - The actual data in the


database at a particular point of time is
known as database instance or database
state or snapshot. The database state is also
called an extension of the schema. The
various states of the database are given here.
1. Empty state
2. Initial state
3. Current state
Database Instance
• Empty state: When a new database is defined, only its
schema is specified. At this point, the database is said to be
in empty state as it contains no data.
• Initial state: When the database is loaded with data for the
first time, it is said to be in initial state.
• Current state: The data in the database is updated
frequently. Thus, at any point of time, the database is said to
be in the current state.
The DBMS is responsible to check whether the database
state is valid state. Thus, each time the database is updated,
DBMS ensures that the database remains in the valid state.
The DBMS refers to DBMS catalog where the metadata is
stored in order to check whether the database state satisfies
the structure and constraints specified in the schema.
An example of instance - PUBLISHER instance
P_ID Pname Phone Email_id
P001 Hills Publications 7134019 h_pub@hills.com

P002 Sunshine Publishers Ltd. 6548909 Null

P003 Paramount Publishing House 9254834 param_house@param.com

You might also like