Professional Documents
Culture Documents
1
Definition
2
Categories of data modeling
Hierarchical database model
Network model
Relational model
Entity-relationship model
3
Hierarchical database model
In hierarchical model, data is organized into a tree like
structure with each record is having one parent record or
root and many children.
The hierarchical database model mandates that each
child record has only one parent, whereas each parent
record can have one or more child records.
In order to retrieve data from a hierarchical database the
whole tree needs to be traversed starting from the root
node.
4
Fig 18. Example of Hierarchical Model
The hierarchical database model looks like an organizational chart or a family tree.
It has a single root segment (Employee) connected to lower level segments
(Compensation, Job Assignments, and Benefits).
Each subordinate segment, in turn, may connect to other subordinate segments. Here,
Compensation connects to Performance Ratings and Salary History.
5
Advantages of Hierarchical Model
Disadvantages Cont’
Easy to understand One parent per child.
Performance is better than Navigation system is
relational data model complex.
Many too many
Disadvantages of Hierarchical Model relationships not supported.
Data independence.
Difficult to access values at lower
level
Deletion of parent node result in
deletion of child node forcefully
Extra space is required for the
storage of pointers
6
Network Model
7
Figure 19: Network Model
8
Relational model
In relational model, the data and relationships are represented
by collection of inter-related tables.
10
Figure 21:Object-Oriented Model 11
This model was primarily used by IBM’s
Information Management Systems in the 60s
and 70s, but they are rarely seen today due to
certain operational inefficiencies.
12
Disadvantages
13
Difference between Object-oriented database
Model & Relational Model
15
16
Entity: An entity can be a real-world object, either animate
or inanimate, that can be easily identifiable.
17
Types of Attributes
18
Derived attribute − Derived attributes are the
attributes that do not exist in the physical database,
but their values are derived from other attributes
present in the database.
20
Single-value attribute − An attribute, that has a
single value for a particular entity is known as
single valued attributes.
21
Multi-value attribute − An attributes that may
have multiple values for the same entity is known
as multi valued attributes.
22
Entity-Set and Keys
23
Candidate keys are defined as the set of fields
from which primary key can be selected.
24
Super Key − is defined as a set of attributes within a
table that uniquely identifies each record within a
table.
Super Key is a superset of Candidate key.
Primary Key − A primary key is one of the candidate
keys chosen by the database designer to uniquely
identify the entity set.
Notes:
• Primary key in ERD is underlined.
25
26
Composite Key: Key that consist of two or more
attributes that uniquely identify an entity occurance is
called Composite key.
But any attribute that makes up the Composite key is
not a simple key in its own.
27
Mapping Cardinalities
Figure 23:One-to-many
29
Many-to-one − More than one entities from entity set A
can be associated with at most one entity of entity set B,
however an entity from entity set B can be associated with
more than one entity from entity set A.
Figure 24:Many-to-one
30
Many-to-many − One entity from A can be associated with
more than one entity from B and vice versa.
Figure 24:Many-to-many
31
ER Diagram Representation
Entity
• Entities are represented by means of rectangles.
• Rectangles are named with the entity set they represent.
Attributes
• Attributes are represented by means of ellipses.
• Every ellipse represents one attribute and is directly
connected to its entity (rectangle).
32
• If the attributes are composite, they are further divided in
a tree like structure.
33
• Derived attributes are depicted by dashed ellipse.
34
Relationships
• One-to-one
•One-to-many
•Many-to-one
•Many-to-many
35
Transforming the E-R Data Model
to the Relational Data Model
36
DEPARTMENT
Belongs to
37