In this tutorial, we will discuss various types of data models, The concept of data models in DBMS, and the Advantages and disadvantages of data models.
- Data models are utilized to address the logical structure of the database.
- A few types of data models exist with their own benefits and limits.
- The ER model, Relational model, and Object-oriented model are among the most famous data models.
Data models in DBMS help to understand the design at the conceptual, physical, and logical levels as it gives a clear image of the data making it more straightforward for engineers or developers to make an actual database.
Data models are utilized to describe how the information is stored, accessed, and updated in a DBMS. A bunch of symbols, images, and text are utilized to address them so every one of the individuals from an association or organization can understand how the data is organized. It gives a set of calculating devices that are immensely used to address the depiction of data.
There are many sorts of data models that are utilized in the business, some of them are:
Types of Data Model
Relational Model
This is the most generally acknowledged or accepted data model. In this model, the database is addressed as a collection of relations as rows and columns of a 2-D table. Each row is known as a tuple (a tuple contains every one of the data for a singular/individual record) while every column addresses a characteristic. For example:
Stu. Id | Name | Branch |
2027195 | Ayush | CSE |
2027289 | Ranjeet | AI & ML |
2027223 | Sagar | CSE |
2027304 | Ujjwal | AI & ML |
The above table shows a connection or relation “STUDENT” with credits as Stu. Id, Name, and Branch which comprises of 4 records or tuples.
Entity-Relationship model (ER Model)
An Entity-Relationship model is a high-level data model that portrays or describes the structure of the database in a pictorial structure which is known as ER graph or diagram. In basic words, an ER diagram is utilized to represent the logical structure of the database. The ER model develops a calculated perspective on the data subsequently it very well may be utilized as an outline or blueprint to execute the database from here on out.
Developers can without much of a stretch comprehend/understand the system by simply seeing ER diagram. We should initially examine the parts of an ER diagram.
- Entity: Anything that has an autonomous presence or independent existence about which we gather the data. They are addressed as square shapes in the ER graph. For example – Car, house, employee.
- Entity Set: A bunch of similar substances/entities is known as an entity set. For example – A set of students studying in a school.
- Attributes: Properties that characterize entities are called attributes. They are addressed by an ellipse shape.
- Relationships: A relationship is utilized to depict the relationship between entities. They are addressed as diamond or rhombus shapes in the ER chart or diagram.
*IMAGE PENDING*
In the above-addressed ER diagram, we have two elements which are Employee and Company and the relationship among them. Likewise, in the above-addressed ER graph, we can see that both workers, employees, and companies have a few attributes and the relationship is of “works in” type, and that implies representative/employee works in an organization.
Object-Oriented Data model
As proposed by its name, the object-oriented data model is a mix of object-oriented programming, and relational data model. In this data model, the data and their relationship are addressed in a single design or structure which is known as an object. Since data is put away as objects we can easily store video, audio, pictures, and so forth in the database which was highly challenging and awkward to do in the relational model. As displayed in the image below two objects are associated with one another through links.
In the above table, we have two objects that are Employee and Department in which every one of the data is contained in a single unit (object). They are connected with one another as they share a common attribute i.e. Department_Id.
Network Model
A network model is only a speculation of the hierarchical data model as this data model permits many to many connections hence in this model a record can also have more than one parent.
The network model can be addressed as a chart or graph and subsequently, it replaces the hierarchical tree with a graph where object types are the nodes and connections are the edges. For example:
Here you can see that every three divisions/departments are connected with the director who was unrealistic in the hierarchical data model. In the network model, there can be numerous possible ways to arrive at a node from the root node (College is the root node in the above case), like this the information can be accessed efficiently when contrasted/compared with the hierarchical data model. Yet, then again, the course of insertion and deletion of data is very complicated.
Hierarchical Model
The hierarchical data model is perhaps/one of the most seasoned/oldest data models, developed during the 1950s by IBM. In this data model, the data is coordinated or organized in a hierarchical tree-like structure. This data model can be effectively imagined on the grounds that each record has one parent and numerous children (possibly 0) as displayed in the picture given below.
The above-given picture addresses the data model of the Vehicle database, vehicle are ordered/classified into two kinds Viz. bikes (two-wheelers) and four-wheelers and afterward they are additionally grouped. The main drawback we can see here is we can have one to numerous connections under this model, thus the hierarchical data model is seldom (very rarely) utilized these days.
Must Read:
Object Relational Data Model
Again as proposed by its name, the object-relational data model is an integration of the object-oriented model and the relational model. Since it acquires or inherits properties from both of the models it upholds objects, classes, and so on like object-oriented models and tabular structures like the relational model. For example:
It gives data structures and tasks or operations utilized in the relational model and furthermore gives highlights of object-oriented models like classes, inheritance, and so forth. The main drawback of this data model is that it is complex and very challenging to deal with.
Associative Data Model
The cooperative data model sees the data similarly to the brain does, i.e. entities and connections between them. The relationship is expressed as a basic English sentence of the structure “subject-verb-object”. For example – From the sentences
- Revathi is a customer
- Revathi’s customer id is 95.
- Ayush is a customer
- Ayush’s customer id is 195.
We can make the following table:
Cust_ID | Name |
95 | Revathi |
195 | Ayush |
Semi-Structured Data Model
The semi-organized or structured data model is a summed-up type of the relational model, which permits addressing data in a flexible way, consequently, we can not separate data and schema in this model because, in this model, a few entities have a missing attribute(s) and then again, a few entities could have some extra attribute(s) which this way makes it simple to update the diagram/schema of the database.
For example – We can say a data model is semi-organized assuming in certain traits or attributes we are storing both atomic qualities or values (values that can’t be partitioned further, for example, Roll_No) as well as a collection of values.
Float Data Model
The float data model comprises a single 2-D array of data components. For example, in the two-dimensional array, we can have one column as a username and the other as a password. One thing that can be seen here is, that there should not be copy entries in the table (array).
For example:
Index | Username | Password |
0 | Ayush | 195Ayu@ |
1 | Nikhil | Pass@211 |
… | … | … |
… | … | … |
… | … | … |
995 | Revathi | @nr#vartika |
The main significant drawbacks of this model are that it fails to store a large amount of data furthermore, to get to any data whole table should be looked through which makes it wasteful or inefficient.
Context Data Model
The context data model is a combination of several data models, that have been examined above. For example, a context model can be a combination of a network model, ER model, and so on. This data model permits one to do numerous things which were impractical (not possible) in the event that he/she utilizes a single data model.
Advantages of Data Models
- The connection between the data is well defined.
- Data models guarantee that the data is addressed precisely or accurately.
- Data overt repetitiveness can be limited and missing data can be recognized without any problem.
- Last yet not minimal, the security of the data isn’t compromised.
Disadvantages of Data Models
- The greatest disadvantage of the data model is, that one should know the characteristics of physical data to construct a data model.
- At times in massive databases, it is very challenging to understand the data model additionally the expense brought about is exceptionally high.
Conclusion
Understanding data models in DBMS is more than just a technical skill—it’s a gateway to optimizing your database management and enhancing overall efficiency. From improving data integrity and facilitating easier data retrieval to providing a clear framework for your database design, the benefits are numerous and impactful. By mastering these models, you position yourself to tackle complex data challenges with confidence and precision. So, dive into the world of data models and unlock the full potential of your database systems, driving your projects towards greater success and innovation.