Table of contents
1.
Introduction
2.
Relational Data Model
3.
Entity-Relationship (ER) Data Model
4.
Object-based Data Model
5.
Semi-structured Data Model
6.
Hierarchical Data Model
7.
Network Data Model
8.
FAQs
9.
Key takeaways
Last Updated: Mar 27, 2024

Data Models

Author ANKIT KUMAR
2 upvotes

Introduction

The data model gives us the conceptual idea of how the data will be stored, manipulated in the database and how the final system will look after its implementation. It is just the conceptual view. Through the data models, we define how the logical structure of the Database will be modelled.

The various types of data models are:

  • Relational Data Model
  • Entity-Relationship (ER) Data Model
  • Object-based Data Model
  • Semi-structured Data Model
  • Hierarchical Data Model
  • Network Data Model
     

Also Read, Schema in DBMS and Checkpoint in DBMS

Relational Data Model

The relational data model is the most widely used model by database management applications. It uses collections of tables for representing data and the relationships among the data. The data is stored in the form of tables which are also known as relations. Each table is a group of columns and rows, where the column represents the attribute of an entity and the rows represent the records (or tuples).

  • Attribute (field)
  • Each column in the table is called an attribute. The domain of each attribute must be the same. For example, if a column represents age where the domain is a positive integer, every age record must have a positive integer value.
  • Tuple (a record)
  • The rows in relation or table are known as a tuple. Tuples are also called records. The tuple is a collection of attribute values.

In the above table, the attributes are Student_ID, name, and age.

There are a total of four tuples in the above table.


Also See - Specialization and Generalization in DBMS And Recursive Relationship in DBMS

Entity-Relationship (ER) Data Model

The ER data model is a high-level data model. It serves as a blueprint for the actual representation of the data, which is later implemented as a database. The ER model is physically represented in the SQL. ER model describes the structure of a database with the help of a diagram, which is known as the entity-relationship diagram. The two main components of the ER model are :

  • Entities
  • An entity is a real-world object or thing. For example, a car, a student, a college, a course. Such things are known as entities. In the ER model, we try to define a relationship or association between two entities. For example, there can be two different entities like managers and departments. Through the ER model, we try to find an association between the managers and the department. The entities have various characteristics known as attributes.
  • Relationship
  • A relationship tells us how various entities are interrelated. It represents the association between two entities. For example, consider two different entities managers and departments, the relationship between them is "manages." Each manager "manages" a department. Similarly, each department will be managed by at least one manager.

Below is an example of an ER model diagram.

Object-based Data Model

The Object-based data model is also known as the object-oriented data model. The object-based data model is just an extension of the entity-relationship model with some extra notions of functions, encapsulation, and object identity. In an object-oriented data model, the data and relationship are present in a single structure called an object. A link is used to connect the objects. These objects are related with the help of the link.

Consider the below example:

There is an employee object. All the data and relationships are contained as a single unit. The attributes and methods are also stored in a single unit.

Also read - multiple granularity in dbms

Semi-structured Data Model

The semi-structured model is a modified form of the relational model. The semi-structured data model allows the data specifications at places where the individual data items of the same type may have different sets of attributes. In this model, some entities may have missing attributes while others may have an extra attribute. The semi-structured data model is represented using the Extensible Markup Language (XML).

Example:

<Employee 1>
<name>..............</name>
<age>.................</age>
<salary>.............</salary>
</employee 1>

 

Hierarchical Data Model

This is one of the older forms of data models. This data model is represented using a tree-like structure. Each entity has only one parent. However, it can have many children. At the top of the hierarchy, there is a single entity known as the root.

Also Read - Cardinality In DBMS

Network Data Model

The network data model is a modified version of the hierarchical model. It is represented by a graph. Unlike the hierarchical model, in the network model, there can be more than one parent entity or the root. It provides extra flexibility in representing the data. It is also easier and faster to retrieve data using this method compared to the network model. Here a child entity can have more than one parent entity, i.e., an entity can be related with multiple entities.

Example:

Recommended Topic, B+ Tree in DBMS

You can also know about different types of DBMS in detail.

FAQs

  1. What is a data model?
    The data model gives us the conceptual idea of how the data will be stored, manipulated in the database and how the final system will look after its implementation.
     
  2. What are the various data models?
    Relational model, ER model, Object-oriented model, semi-structured model, hierarchical model, network model.
     
  3. Which data structure is used in hierarchical data models?
    Tree data structure.
     
  4. How is the relational data model represented?
    In the form of tables having rows and columns.
     
  5. Which data structure is used in a network data model?
    Graphs.

Take this awesome course from coding ninjas.

Key takeaways

  • The data model gives us the conceptual idea of how the data will be stored, manipulated in the database and how the final system will look after its implementation.
  • Through the data models, we define how the logical structure of the database will be modelled.
  • The various types of data models are the Relational model, ER model, Object-oriented model, semi-structured model, hierarchical model, network model.
  • The relational model uses collections of tables for representing data and the relationships among the data. The data is stored in the form of tables which are also known as relations. 
  • The ER data model is a high-level data model. It serves as a blueprint for the actual representation of the data, which is later implemented as a database.
  • The object-based data model is just an extension of the entity-relationship model with some extra notions of functions, encapsulation, and object identity.
  • The semi-structured method is a modified form of the relational model. The semi-structured data model allows the data specifications at places where the individual data items of the same type may have different sets of attributes.
  • The network data model is a modified version of the hierarchical model. It is represented by a graph.

Never stop learning. Explore the top 100 SQL problems here.

Happy learning!

Live masterclass