2. Data Models
•A data model is collection of tools for
describing
a)data
b)data relationships
c)data semantics
d)data constraints
Dinesh Kumar Bhawnani, BIT DURG
3. Types of Data Models
•There are basically two types of data models
a)Record based Data Models.
b)Object based Data Models.
Dinesh Kumar Bhawnani, BIT DURG
4. Record based Data Models
Dinesh Kumar Bhawnani, BIT DURG
• In Record-based models, the database is organized in
fixed-format records of several types.
• A fixed number of fields, or attributes, are defined in
each record type, and each field is usually of a fixed
length.
• The three most popular record-based data models are
1. Hierarchical Data Model
2. Network Data Model
3. Relational Data Model
5. Hierarchical Data Model
• In the hierarchical model, data are represented by collections of
records.
• Relationships among data are represented by links.
• In this model Tree data structure is used.
• There are two concepts associated with the hierarchical model –
segment types and parent-child relationships.
• Segment type is similar to the record types in the network models.
• The information retrieved only by navigating from the root segment
type to the nodes segment types. Thus you can access a segment
type only via its parent segment type in the parent-child relationship.
Dinesh Kumar Bhawnani, BIT DURG
8. Advantages of Hierarchical Data Model
1. Simplicity
2. Data Security
3. Data Integrity
4. Efficiency
Dinesh Kumar Bhawnani, BIT DURG
9. Disadvantages of Hierarchical Data Model
1. Implementation Complexity
2. Database management problems
3. Lack of structural independence
4. Programming complexity
5. Implementation limitation
Dinesh Kumar Bhawnani, BIT DURG
10. Network Data Model
1. The Database Task Group of the conference on Data
System Languages (DBTG/ CODASYL) formalized the
network data model in the late 1960s.
2. The network data model is similar to a hierarchical
model except that a record can have multiple
parents.
3. The network data model has three basic
components such as record type, data items (or
fields) and links.
Dinesh Kumar Bhawnani, BIT DURG
11. Network Data Model
1. In network model, a relationship is called a set in which
each set is composed of at least two record types.
1. Owner record that is equivalent to the parent in the hierarchical
model.
2. Member record that is equivalent to child in the hierarchical
model.
2. The connection between an owner and its member records
is identified by a link to which database designers assign a
set-name.
3. This set-name is used to retrieve and manipulate data.
Dinesh Kumar Bhawnani, BIT DURG
13. Network Data Model
1. In the network model, data are represented by
collections of records.
2. Relationships among data are represented by
links.
3. In this model Graph data structure is used.
4. A network model permits a record to have
more than one parent.
Dinesh Kumar Bhawnani, BIT DURG
15. Advantages of Network Data Model
1. Simplicity
2. Ability to handle more relationship types
3. Ease of data access
4. Data Integrity
5. Data Independence
6. Database Standards
Dinesh Kumar Bhawnani, BIT DURG
16. Disadvantages of Network Data Model
1. System Complexity
2. Lack of structural independence
Dinesh Kumar Bhawnani, BIT DURG
17. Relational Data Model
1. The relational model was discovered by Dr. E. F.
Codd.
2. The relational model uses tables to represent the
data and the relationships among those data.
3. Each table has multiple columns, and each column is
identified by a unique name.
4. It is a low level model.
Dinesh Kumar Bhawnani, BIT DURG
19. Advantages of Relational Data Model
1. Structural Independence
2. Simplicity
3. Ease of designing, implementation, maintenance, and usage
4. Adhoc query capability
Dinesh Kumar Bhawnani, BIT DURG
20. Disadvantages of Relational Data Model
1. Hardware Overheads
2. Ease of design can result in bad design
Dinesh Kumar Bhawnani, BIT DURG
21. Difference between hierarchical, network and
relational data models
SNO Hierarchical Network Relational
1 Relationship between records is
of parent child type.
Relationship between records is
expressed in the form of
pointers or links.
Relationship between record is
represented by a relation that
contains a key for each record
involved in the relations.
2 Many-to-many relationship
cannot be expressed in this
model.
Many-to-many relationship can
also be implemented.
Many-to-many relationship can
be easily implemented.
3 It is a simple, straightforward
and natural method of
implementing record
relationships.
Record relationship
implementation is quite
complex due to the use of
pointers.
Relationship implementation is
very easy though the use of a
key or composite key field(s).
Dinesh Kumar Bhawnani, BIT DURG
22. Difference between hierarchical, network and
relational data models
SNO Hierarchical Network Relational
4 This type of model is useful only
when there is some hierarchical
character in the database.
Network model is useful for
representing such records which
have many-to-many
relationships.
Relational model is useful for
representing most of the real
world objects and relationships
among them.
5 In order to represent links
among records, pointers are
used. Thus relationships among
records are physical.
In Network model also the
relationship among records are
physical.
Relational model does not
maintain physical connection
among records. Data is
organized logically in the form
of rows and columns and stored
in table.
Dinesh Kumar Bhawnani, BIT DURG
23. Difference between hierarchical, network and
relational data models
SNO Hierarchical Network Relational
6 Searching for a record is very
difficult since one can retrieve a
child only after going though its
parent record.
Searching a record is easy since
there are multiple access paths
to a data element.
A unique, indexed key field is
used to search for a data
element.
7 During updation or deletion
process, chance of data
inconsistency is involved.
No problem of inconsistency
exists in network model because
a data element is physically
located at just one place.
Data integrity maintaining
methods like Normalization
process, etc. are adopted for
consistency.
Dinesh Kumar Bhawnani, BIT DURG
24. Object Based Data Models
•In Object-based models, the database is organized in
real world objects of several types. A number of
fields, or attributes, are defined in each object type,
and each field is usually of a variable length.
•The two most popular object-based data models are
a) E R Model (Entity Relationship Model)
b) Object oriented model
Dinesh Kumar Bhawnani, BIT DURG
25. ER Model (Entity Relationship Model)
• The entity-relationship model is based on a perception of the world
as consisting of a collection of basic objects (entities) and
relationships among these objects.
• It was discovered by Peter Chen in 1976.
• It is a high-level data model.
• An entity is a distinguishable object that exists.
• Each entity has associated with it a set of attributes describing it.
• A relationship is an association among several entities.
Dinesh Kumar Bhawnani, BIT DURG
26. ER Model (Entity Relationship Model)
• The set of all entities or relationships of the same type is called the
entity set or relationship set.
• Another essential element is the E-R diagram in which the mapping
cardinalities express the number of entities to which another entity
can be associated via a relationship set.
• The overall logical structure of a database can be expressed
graphically by an E-R diagram:
a) Rectangles : represent entity sets.
b) Ellipses : represent attributes.
c) Diamonds : represent relationships among entity sets.
d) Lines : link attributes to entity sets and entity sets to relationships.
Dinesh Kumar Bhawnani, BIT DURG
27. ER Model (Entity Relationship Model)
Dinesh Kumar Bhawnani, BIT DURG
28. Advantages of ER Model
1. Straightforward relational representation
2. Easy conversion for ER to other data model
3. Graphical representation for better understanding
Dinesh Kumar Bhawnani, BIT DURG
29. Disadvantages of ER Model
1. No industry standard for notation
2. Popular for high-level design
Dinesh Kumar Bhawnani, BIT DURG
30. Object Oriented Data Model
• The object-oriented model is based on a collection of objects, like the E-R
model.
• An object contains values stored in instance variables within the object.
• Unlike the record-oriented models, these values are themselves objects.
• Thus objects contain objects to an arbitrarily deep level of nesting.
• An object also contains bodies of code that operate on the object. These
bodies of code are called methods.
• Objects that contain the same types of values and the same methods are
grouped into classes.
Dinesh Kumar Bhawnani, BIT DURG
31. Object Oriented Data Model
• A class may be viewed as a type definition for objects.
• The only way in which one object can access the data of another object is
by invoking the method of that other object. This is called sending a
message to the object.
• Internal parts of the object, the instance variables and method code, are
not visible externally.
• Result is two levels of data abstraction.
• Unlike entities in the E-R model, each object has its own unique identity,
independent of the values it contains:
1. Two objects containing the same values are distinct.
2. Distinction is maintained in physical level by assigning distinct object identifiers.
Dinesh Kumar Bhawnani, BIT DURG
34. Advantages of OO Model
1. Capable of handling a large variety of data types.
2. Combining object-oriented programming with
database technology
3. Improved productivity
4. Improved data access
Dinesh Kumar Bhawnani, BIT DURG
35. Disadvantages of OO Model
1. No precise definition
2. Difficult to maintain
3. Not suited for all applications
Dinesh Kumar Bhawnani, BIT DURG
36. University Questions
• What are data models?
• Describe different types of data models.
• Enumerate the different types of data models existing for structured
data storage.
• What are the various types of data model? Explain in brief.
• What is the difference between hierarchical, network and relational
data model?
Dinesh Kumar Bhawnani, BIT DURG
37. For Video lecture on this topic please subscribe to my youtube channel.
The link for my youtube channel is
https://www.youtube.com/channel/UCRWGtE76JlTp1iim6aOTRuw?sub
_confirmation=1
Dinesh Kumar Bhawnani, BIT DURG