Hierarchical data model, mesh data model and relational data model of logical data model

Source: Internet
Author: User

The previous article briefly introduced the conceptual data model, the logical data model, the physical data Model basic concept, the characteristic as well as the three corresponding database development stage. Now for the three kinds of data models used in the logical data Model---Hierarchical data model, mesh data model and relational data model to do a trust introduction and comparative analysis.

  One, hierarchical data model

  definition: A hierarchical data model is a data model that represents the relationship between entity types and entities using a Tree < hierarchy > structure. (from Baidu Encyclopedia)

In fact, the hierarchical data model is a graphical representation of an inverted growth tree, from the basic data structure of the tree (or binary tree) definition, each tree has and only one root node, the rest of the nodes are non-root nodes. Each node represents a record type corresponding to the concept of the entity, and the individual fields of the record type correspond to the individual properties of the entity. Each record type and its fields must be logged.

  characteristics: The nature of a tree determines the characteristics of a tree-like data model

1. There is only one node in the entire model that has no parent node, and the remaining nodes must have only one parent node, but all nodes can have no child nodes;

2. All child nodes can not be separated from the parent node, that is, if you want to delete the parent node, then all child nodes under the parent node are deleted, but some leaf nodes can be deleted separately;

3. Each record type has and only one path from the parent node to itself;

  Instance:

1, the structure of hierarchical data model is illustrated by taking the organizational structure of a school department as an example.

1. The record type is the root node whose attributes are the system number and the name of the system;

2. Record type departments and students constitute the record type of sub-nodes, the properties of the Teaching and Learning Department and the office name, students are the attributes of the student number, name and performance;

3. Record type the teacher is the child node of this entity, whose attribute is the teacher's number, the teacher's name, and the teacher's research direction.

  Advantages:

1. Hierarchical data model structure is simple, clear and clear, it is easy to see the linkages between the various entities;

2. Operation level data Type database statement is relatively simple, only need a few statements to complete the operation of the database; (Baidu Encyclopedia)

3. The query efficiency is high, in the hierarchical data model, the node's forward edge represents the connection between nodes, in the DBMS if there is a pointer to the side of the implementation, then the path is easy to find unknown origin records;

4. Hierarchical data model provides good data integrity support, as mentioned above, if you want to delete the parent node, then all the child nodes under it should be deleted at the same time, 1, if you want to delete the department, all the teachers under it to delete;

  Disadvantages:

1. Hierarchical data models can only represent 1:n relationships between entities and cannot represent the complex relationships of m:n, so many models in the real world cannot be easily represented by the model;

2. When querying a node, it is necessary to know the parent node, thus restricting the control of the database access path;

Figure 1. Composition of the Department of Personnel structure

  Second, mesh data model

  definition: A data structure model that represents a relationship between entities and entities in a graph is called a mesh data model.

Hierarchical data model, mesh data model and relational data model of logical data model

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.