Data Modeling Examples

您所在的位置:网站首页 modelling Data Modeling Examples

Data Modeling Examples

#Data Modeling Examples | 来源: 网络整理| 查看: 265

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.

Types of Data Modeling

ER (Entity-Relationship) Model

Hierarchical Model

Relational Model

Object-Oriented Database Model

Object-Relational Model

What is Data Modeling

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.

Importance of Data Modeling A data model assists in designing the database at the physical, logical, and conceptual levels. The data model establishes stored procedures, relational tables, foreign and primary keys. It gives a clear picture of the database, and database developers can use it for creating physical databases. The data model depicts the best understanding of the business requirements. The data model is also useful for identifying redundant and missing data.

MindMajix Youtube Channel

Advantages of Data Modelling

Following are the essential advantages of Data Modelling

The data model assists us in identifying proper data sources to inhabit the model. The Data Model enhances communication throughout the organization. Data Model assists in documenting the data mapping in the ETL process. Data modeling enables us to query the data of the database and obtain different reports according to the data. Through the reports, data modeling helps in data analysis.

[Related Article: Data Modelling Interview Questions for Beginners]

Data Modeling Terminology Entity: Entities are the items of the business environment regarding which we need to store the data. Example: Customers, Orders, Products, etc. Attribute: Attributes give a way of structuring and organizing the data. Relationship: Relationship among the entities explains how one entity is connected to another entity. Reference Table: We can resolve the many-to-many relationships among the entities into one-to-many and many-to-one relationships through a reference table. Database Logical Design: It defines the database inside a data model of a particular database management system. Logical Design: In Logical design, we create all the keys, tables, rules, constraints, etc. Database Physical Design: It defines the file organization, internal database storage design and indexing techniques. Physical Model: It is the physical depiction of the database. Schema: It is the complete description of the database. Logical Schema: Logical Schema is a theoretical design of a database that we do on a whiteboard or a paper, and it is similar to the structural diagram of a house.  Important Perspectives of a Data Model 1. Logical Model

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.

2. Conceptual 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.

3. Physical 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.

4. Facts and Dimensions

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]

Types of Data Models 1. ER (Entity-Relationship) Model

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.

-Entity

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

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.

-Attributes

We represent the entities through their properties, and these properties are known as attributes. Every attribute will have value.

-Key

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.

-Relationship

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.

-Relationship Set

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:

One-to-One Relationship One-to-Many Relationship Many-to-One Relationship Many-to-Many Relationship

ER Diagram Example:

Data Modeling ER Diagram

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.

2. Hierarchical Model

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]

Hierarchical Model

3. Relational Model

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.

Student_Id Student_Name Student_Age 01 Vijay 20 02 Ramesh 22 03 Rakesh 21 04 Varun 25

 

Subject_Id Subject_Name Subject_Teacher 001 Java Mr. A 002 Linux Mr. B 003 C Mr.J 004 C++ Mr.C

From the above two tables, we will get the following resultant table: 

Student_Id Subject_Id Marks 1 002 95 2 001 87 1 003 85 3 001 80 4. Object-Oriented Database Model

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:

Multimedia Database

A multimedia database includes media like images that we cannot store in a relational database. 

Hypertext 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. 

Network 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.

5. Object-Relational Model

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.

Conclusion

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.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3