What Is A Data Model In DBMS? What Are Its Types?

  • What is Data Model in DBMS?
  • Types of Data Model in DBMS
  • A Hierarchical Model
  • Network Model
  • Entity-Relationship (ER) Data Model
  • Relational Model
  • Object-Oriented Database Model
  • Object-Relational Model
  • Flat Data Model
  • Semi-Structured Model
  • Associative Data Model
  • Context Data Model

Database models illustrate the logical structure of a database and the relationships and constraints that determine how data can be accessed and stored. They are designed based on whatever broader data model the designers adopt. As a model of reality, it represents objects and events of the real world, as well as their relations.

The data model is used to describe the way information is stored and retrieved from a database. It also defines the rules by which the database will operate.

Let’s see a brief description of the data models in DBMS.

ALSO READ

What Is Regression In Data Mining?

What is Data Model in DBMS?

A data model can be defined as an integrated collection of concepts describing and manipulating data, as well as constraints on the data within an organization. A data model is not just a set of tables; it is a conceptual representation of physical data stored in the database.

For example, if you have a table with a column for each employee’s name, then there are many possible ways to represent this information: as one row per employee, or as multiple rows per employee (one row per department), or as multiple rows per person (one row for each job title). Each of these models has its own strengths and weaknesses.

The first step in designing a data model is to define what kind of data you want to store in your database. This usually involves defining the entities involved in your application. An entity is any object that exists independently of anything else. You might think about an entity as something like a “person” or an “address.” Once you’ve identified all the entities, you need to decide how they relate to each other. In most cases, the answer to this question depends on what type of business process you’re modeling.

The next step is to figure out how those entities will interact with each other. In some applications, you may want to create a single table to hold all the data about a particular entity. However, you could also use several tables, where each table holds only part of the data about an individual entity.

In addition, you should consider whether you’ll need to perform queries across more than one table. If so, you’ll probably need to link them together using foreign key columns.

Once you know the basic structure of your data model, you can start thinking about how best to organize it into tables. There are two main approaches: relational databases and hierarchical databases. Relational databases are organized around a set of tables that share common fields. Hierarchical databases are organized around a tree-like structure called a hierarchy. Both approaches allow you to build complex structures quickly, but they do so at the cost of flexibility.

Why use Data Models?

Data Models are extremely useful for any organization as it lets business users directly define core business rules. As a result, fewer revisions are required during implementation. It also leads to significant reductions in the development time, allowing businesses to deliver new businesses and projects faster.

Overall, the advantages of using data models can be summed up briefly in the following way:

1. Helps to cut costs and deliver products faster

2. It improves business processes significantly

3. Reduces complexity and risks in data handling

Now, let’s discuss the various types of data models in DBMS in detail.

Types of Data Model in DBMS

There are a variety of models for data. Some of the most well-known models include:

  • A Hierarchical model
  • Network model
  • Model of Entity-Relationship
  • Relational Model
  • Object-Oriented Data Model
  • Object-Relational Data Model
  • Flat Data Model
  • Semi-Structured Data Model
  • Associative Data Model
  • Context Data Model

You can describe your database using any of these based on a variety of variables. The most important thing to consider is the degree to which the database management software that you’re using is compatible with specific models. The majority of database management systems are designed with a specific database model and will require users to follow that model, however, some support multiple models.

Furthermore, there are different models that can be applied to various stages of the design process for databases. Conceptual data models that are high-level are the best way to map out relationships between data in the way which people can see the data. Logical models that are based on records, however, are more closely reflected in the way the data is stored at the data server.

When choosing a data model, it’s equally about setting your priorities in relation to the database and the strengths of a specific model, regardless of whether your goals are speed, cost savings usability, or something different.

Let’s take a glance at the top popular databases models.

ALSO READ

Most Common Programming Interview Questions With Answers 2022

1. A Hierarchical Model

The hierarchical data model was the first DBMS-based model. This model organizes data in a hierarchical tree structure. The hierarchy begins at the root, which contains root data. It then expands into a tree adding child nodes to the parent node. This model can easily represent some real-world relationships, such as sitemaps and recipes for food, or even website navigation.

Example: The relationship between different kinds of humans can be represented in the following manner:

Characteristics of Hierarchical Model:

  1. One to many relationships: Here, the data is organized in a tree-like manner where there is a one-to-many relationship between data types. There can only be one path from any parent to any node. Example: If we want to get to the root node, there is only one way to do so. It’s through the men’s shoe node.
  2. Parent-Child Relationship Every child node has its parent node, but a parent can have more than one child. Multiple parents are prohibited.
  3. Deletion Issue: When a parent node has been deleted, the child node will also be deleted.
  4. Pointers: Pointers link the parent and child nodes. They are used for navigation between stored data.

Example: The visual representation of the basic concepts of the database schema is shown below where the human node points to two other nodes, the Women, and the Men. This example is explained by taking real-world entities.

The Advantages of the Hierarchical Model

  • It’s very easy and quick to navigate through a tree-like structure.
  • Changes in the parent node are automatically reflected in child nodes so data integrity is maintained.
  • Easy to find the difference.

The Disadvantages of the Hierarchical Model

  • Complex relationships cannot be supported.
  • It does not support more than one parent of the child Node. If there is a complex relationship, where a child Node requires two parent nodes, it cannot be represented with this model.
  • The child node will be deleted automatically if a parent node has been deleted.

2. Network Model

This model is an extension of the hierarchical one. This model was the most well-known before the relational one. The hierarchical model can have multiple records. This model is identical to the hierarchical one. It replaces the hierarchical trees with a graph.

Example: In this example, we can see that a node student has two parents. CSE Department and Library. In the hierarchical structure, this was not possible.

Characteristics Of Network Model

  1. Ability To Merge More Relationships: In this model, data is more closely related to more relationships. This model can manage both one-to-one and many-to-many relationships.
  2. Many routes: Because there are many relationships, there may be multiple paths to the same record. This allows data access to be quick and easy.
  3. Circular Link List: The operations on the network model can be done using the circular linked list. A program maintains the current position and navigates through the records based on the relationship. The physical structure of the network model is

Network Model Advantages

  • Data can be accessed more quickly than the hierarchical model. Because the data in the network model is more closely related, and it is possible to take more than one route to reach a particular point, this is why the data can be accessed faster. The data can therefore be accessed in many different ways.
  • Data integrity is guaranteed because there is a parent/child relationship. Any changes in the parent record are reflected in a child record.

Network Model’s Disadvantages

  • The system can become more complicated as more relationships are needed to be managed. To be able to use the model, the user must have a good understanding of it.
  • Any type of change, such as updating, deletion, or insertion, is extremely complex.

ALSO READ

Top 50 OOPs Interview Questions With Answers 2022

3. Entity-Relationship (ER) Data Model

Entity-Relationship Data Model, or simply (E-R) Model UML is a high-level diagram of a data model. This model shows the real-world problem in a pictorial format to make it easier for stakeholders to understand.

DBMS — ER Model diagram makes it easy for developers to see the system. The E-R model Diagram is used to show an ER Model or domain model. The following components make up the ER Diagram:

  • Entities Entity: A real-world thing, entity. It could be a person, a place, or even an idea. Examples: Students, Teachers, Courses, Buildings, Departments, etc. are all examples of entities that make up a School Management system.
  • Attributes An entity can contain a real-world property called an attribute. These are the attributes of the attribute. Example: An entity student owns the property student id and age, and so forth.
  • Relationship — Relationship shows how two attributes are related. Example: A student working in a department.

The entities in the diagram are student and course. Student entity attributes are Student_Id and Student_Age. Entity Course has the attributes Course_Id and Course_Credits. These entities are linked using the relationship. Each student works in a specific department.

Characteristics of the ER Model

  • Graphical representation for better understanding: It’s very simple and easy to understand, so developers can use it to communicate with stakeholders.
  • ERD Diagram: ERD diagram is used to represent the model visually.
  • Design of a Database: This model is used by database designers to create a database.

The Advantages of the ER Model

  • Easy: Conceptually, an ER Model can be very simple to create. The ER Diagram can be easily created if we know the relationships between the entities and attributes.
  • Effective Communication Tools: Database designers use this model to communicate their ideas.
  • Conversion to Any Model This model is compatible with the relational model. It can easily be converted to a relational model by converting ER to the table. In fact, this model can be easily converted to any model such as a hierarchical or network model.

Disadvantages of the ER Model

  • There is no industry standard in notation: It is impossible to develop an ER model according to industry standards. One developer may use notations that aren’t understood by others.
  • Hidden Information: There is some information that might be lost or hidden within the ER model. It is possible that some information may be lost or hidden because it is a high-level view.

4. Relational Model

The relational model is the most popular model. It is a model where the information is stored as two-dimensional tables. All information is stored in rows and columns. The foundation of a model that is relational is tables. Therefore the tables are known as relations within the model. Examples: In this example, there is a student data table.

Characteristics of Relational Model

  • Tuples Each row within the table is known as the tuple. Each row is comprised of all the details regarding any particular specific instance. In the example above each row is filled with all the information regarding a particular person, just like the first row contains information regarding Arya.
  • Field or attribute: Attributes are the property that defines the table or relationship. The attributes’ values must be within that same domain. In the example above there are different aspects of an employee such as Salary Mobile_no, Salary, etc.

NamesRoll_NoPhone_NoAddressAGENeha980987305758990Varanasi20Narayan128308026288936Delhi10Amit3309898583289090Bihar16Khushi2785790708687878Patna14Ganesh17282902893988Bangalore23

  • Basic: This database model is less complex, compared to the network model and hierarchical models.
  • Scalable: This is a model that can scale easily so that we add as many columns and rows as we’d like.
  • Structural Independence It is possible to alter the structure of the database without altering the method for accessing the information. If we can make modifications to the database structure, without altering the ability of DBMS in accessing data, we can claim that structural independence is attained.

Disadvantages of Relational Model

  • Hardware Overheads: For concealing the complexity and making it easier for the user, this model calls for more powerful hardware computers as well as devices for storing data.
  • Poor Design: Because the model of relationship is extremely easy to create and utilize. Therefore, users don’t have to understand how data is stored for them to gain access to it. This simplicity of design could cause the development of a bad database, which could slow down as the database expands.

However, these issues are insignificant when compared to the benefits associated with the relationship model. The problems could be prevented with the proper implementation and management.

ALSO READ

50 Frequently Asked LinkedList Interview Questions With Answers 2022

5. Object-Oriented Database Model

The actual problems are precisely represented by the object-oriented model. Object-oriented database models combine both data and the relationship are contained in a single structure referred to as an object. It is possible to store images, audio, videos, and more in databases that were not possible with the relational model (although you could save video and audio in a relational database, it is advised not to store them in relational databases).

The model, in this case, their additional objects that are linked by hyperlinks. This link is used to connect one object to other objects. This is explained from the example below.

In the example above we have an object of the customer (or a single parent node). The data and relationships for each object are organized as a single entity. The primary key such as Bank Account, Pune_Address, and the Delhi_Address as well as the processes that will be used by that object are recorded in a single entity. The objects are linked via the same attribute i.e the Customer_Name. The communication between them is done through this common identification. This is the representation of the physical model of Object-oriented data model

6. Object-Relational Model

It is a mix of the relational model and object-oriented model. This model was designed to bridge the gap between an object-oriented model and a relational model. It has several advanced features such as we can create complicated data types based on our needs using available data types. The issue in this particular model is it is often complicated and challenging to manage. Therefore, a thorough understanding of the model is necessary.

ALSO READ

What Is Regression In Data Mining?

7. Flat Data Model

A flat Model is a basic model where the database is presented as a table composed of columns and rows. To access any information the computer must go through all of the tables. This can make the process extremely slow as well as inefficient.

A flat (or tables) model is two dimensions of a single array of data elements, in which every member of a column will be assumed to have similar values and all elements of the row are presumed to be connected to each other.

Example: The below model structure shows that the data is stored in a table and there is no relational between tables. It is basically a record base model.

8. Semi-Structured Model

A semi-structured model is a modified version of the model known as the relational. It is impossible to distinguish between schema and data in this model.

Example: Web-Based data sources, which aren’t able to differentiate between schema and data of the site. This model is based on the assumption that certain entities might have attributes that are missing while other entities may include an additional attribute. This model allows for flexibility in the storage of information. It also allows for flexibility in the attributes.

Examples: If we are keeping any value in an attribute, that value could be either an atomic value or a set of values. It is a file model in the database.

ALSO READ

Most Common Programming Interview Questions With Answers 2022

9. Associative Data Model

An associative model or Associative Data Model (ADM) is a kind of model that has the data divided into two components. Everything that has an independent existence is termed an entity and the connection between the entities is called connection.

The associative model that is divided into two components is referred to as links and items.

  • Items The items contain names and an identifier(some number).
  • Link: Link contains the identification number of the source, verb, and subject.

This is shown by using the table below:

10. Context Data Model

Context Data Model is a collection of a variety of models. It is comprised of models such as network models, object-oriented data models, relational models, etc. With this model, we are able to accomplish a variety of tasks that aren’t achievable using just one model.

Definition: Data Model is the modeling of the description of data along with the data semantics and consistency constraints on the data. It offers the conceptual tools to describe the structure of a database at every degree of data abstraction.

Types: There are various types of data models in DBMS some of them are the Hierarchical model, Network model, Model of Entity-Relationship, Relational Model, Object-Oriented Data Model, Object-Relational Data Model, Flat Data Model, Semi-Structured Data Model, Associative Data Model, Context Data Model.

You might also be interested in reading:

  1. 8 Highest Paying Jobs For Computer Science Professionals In India
  2. Top 18 Artificial Intelligence Project Ideas for 2022
  3. Test Plan vs Test Strategy: What Makes The Two Different?
  4. Top 101 Java Interview Questions And Answers That IT Companies Ask!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Unstop

Unstop

Unstop (formerly Dare2Compete) enables companies to engage with candidates in the most interactive way to discover, assess, and hire the best talent.