To store data in a database, we must first construct a data model for it. An abstract representation of data items and their interactions is known as a data model. It is similar to an architect's blueprint in that it aids in the construction of a conceptual model. In this post, we'll look at some real-world instances of data modeling and the many sorts of models that exist.
The Data Modeling process creates a data model for the data that we want to store in the database. The data model is a theoretical depiction of the data objects and the relationships among them. A Data Model looks like a building plan of an architect, and it assists in building a conceptual model.
In this article, we will study data modeling examples and types of data models.
If you want to enrich your career and become a professional in Data Modelling, then visit Mindmajix - a global online training platform: "Data Modelling Training" This course will help you to achieve excellence in this domain.
Data Modelling is the process of producing a data model for the data that we want to store in the database. A data model highlights the essential data and how we must arrange that data. Data models assure uniformity in the naming conventions, security semantics while assuring the data quality.
Following are the essential advantages of Data Modelling
[Related Article: Data Modelling Interview Questions for Beginners]
The logical model tells us how we should implement the model. It contains all types of data that we need to capture like columns, tables, etc. Generally, Data Architects and Business Analysts design the logical data model.
The conceptual model specifies what should be present in the data model structure to organize and define the business concepts. It mostly concentrates on business-oriented attributes, relations and entries. Generally, Business Stakeholders, Data Architects design this model.
The physical model specifies how we implement the data model through the database management system. It summarizes the implementation methodology with respect to CRUD operations, tables, partitioning, indexes, etc. Database Developers and Administrators create the Physical Model.
For learning the data modeling, we must understand Facts and Dimensions:
Dimension Table: Dimension Table gathers fields that contain a description of the business elements, and different fact tables to refer to it.
Fact Table: Fact Table contains the granularity and measurements of each measurement. Facts may be semi-additive, additive, For example: Sales.
5. Dimensional Modeling
Dimensional Modelling is a data designing method of the data warehouse. It utilizes the facts and dimensions and assists in simple navigation. Dimensional data model assists in quick performance query. Generally, dimensional models are also known as star schemas.
[Related Article: Salesforce Data Modelling]
The ER Model establishes the theoretical view of the database. It works around the real-time entities and the relationships among them. In View level, we consider ER models as the best option to design the databases.
The entity is a real-world object, and we can identify it easily. For instance, in an employee database, we consider the employee as an entity. All these entities contain few properties or attributes that provide them with their identity.
Entity Set is a group of similar types of entities. Entity sets can have entities in which attributes share identical values. For instance, an Employee set may have all the employees of an organization, similarly, a Student set will have all the students of a school.
We represent the entities through their properties, and these properties are known as attributes. Every attribute will have value.
A Key can be a single attribute or a group of attributes that clearly recognizes an entity in the given entity set. For instance, we can identify an employee among many employees through her/his id.
The Association among the entities is known as a relationship. For example, a student “studies” in a school. Here “Studies” is the relationship between the “Student” and “School” entities.
A group of relationships of a similar type is known as a relationship set. A relationship set will have attributes, and these attributes are known as descriptive attributes.
-Binary Relationship and Cardinality
A relationship that involves two entities is known as a Binary relationship. Cardinality is the number of occurrences of an entity set that can be connected with the other entity set through a relationship.
Entities have four cardinal relationships, they are:
ER Diagram Example:
In the above ER Model, we have four entities: 1) Publisher 2) Books 3) Subject 4) Author, we also have two attributes, are 1) BookId 2) AID. BookId is the attribute of the “Books” entity, and AID is the attribute of the “Author” entity. “Publish” is the relationship between the “Publisher” entity and the “Books” entity, as publishers can publish many books, it is a one-to-many relationship.
“About” is the relationship between the “Books” entity and the “Subject” entity, as we can have many books for one subject, it is a many-to-one relationship. “By” is the relationship between the “Books” entity and the “Author” entity.
This data model arranges the data in the form of a tree with one root, to which other data is connected. The tree hierarchy begins with the “Root” data, and extends like a tree, by inserting the child nodes to the parent node.
In this model, every child node will have only one parent node.
This model effectively explains several real-time relationships like an index of recipes, or a book, etc. The hierarchical model organizes the data in a tree-shape structure with a single one-to-many relationship between two different kinds of data.
For example, one college can have different departments and many faculties.
In the below hierarchical model, “College” is the Root node and it has two child nodes: 1) Department 2) Infrastructure. “College” has a one-to-many relationship with “Department”.
[Realated Article: Tools of Data Modelling]
The relational model is the most common data model. It arranges the data into the tables, and tables are also known as relations. Tables will have columns and rows. Every column catalogs an attribute present in the entity like zip code, price, etc.
Attributes of a relationship are known as a domain. We can select a specific attribute or a mix of attributes as the primary key, and we can refer to it in other tables when it is a foreign key.
Every row is known as a tuple, and it contains data related to a particular instance of an entity. This Model is also responsible for the relationships among those tables, that comprise one-to-many, many-to-many, and one-to-one relationships.
From the above two tables, we will get the following resultant table:
The object-oriented database model defines the database as an object collection, or recyclable software components, with related methods and features. Following are the different types of Object-oriented databases:
A multimedia database includes media like images that we cannot store in a relational database.
A Hypertext database enables any object to connect to any other object. It is useful for arranging plenty of diverse data, yet it is not suitable for data analysis.
An object-oriented database model is the popular post-relational database model, as it includes tables. This model is also known as a hybrid database model.
The network model is an extension of the hierarchical model, and it enables many-to-many relationships among the connected records. In this model, we arrange the data in a graph-like structure, and it can have multiple parent nodes.
According to the mathematical set theory, we construct the network model along with sets of connected records. Every set comprises a parent record or one owner or at least one child record.
A record may be a child or member in multiple sets, by enabling this model we can reveal difficult relationships.
The following diagram represents the Network model. An Agent Manages many Entertainers and Represents many Clients. Similarly, a Client makes many Payments and Schedules many Engagements.
So, the Network model enables many-to-many relationships among the data nodes.
The object-relational model is a hybrid database model that blends some advanced functionalities of the object-oriented database model with the ease of the relational model.
In core, it enables the designers to embed the objects into the usual table structure.
Call interfaces and Languages are SQL3, JDBC, ODBC, etc. These languages and call interfaces act as extensions to the languages and interfaces of the relational model.
Data modeling plays a vital role in storing the data as per user requirement. As users deal with vast amounts of data, they have to model it for understanding or using it. So, they will use different types of data models to model the data. I hope this article provides you with essential information about types of data models with examples.
If you have any queries, let us know by commenting in the below section.
Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!
|Data Modeling Training||May 21 to Jun 05|
|Data Modeling Training||May 23 to Jun 07|
|Data Modeling Training||May 28 to Jun 12|
|Data Modeling Training||May 30 to Jun 14|
Viswanath is a passionate content writer of Mindmajix. He has expertise in Trending Domains like Data Science, Artificial Intelligence, Machine Learning, Blockchain, etc. His articles help the learners to get insights about the Domain. You can reach him on Linkedin
Copyright © 2013 - 2022 MindMajix Technologies