Three types of data models

Source: Internet
Author: User
Tags most popular database

1, the Cow Customer network title:


2. Reference: http://blog.csdn.net/u013341524/article/details/19557597

The type of database is divided according to the data model, and any DBMS is designed according to the data model, which means that the database must be organized into a data model conforming to the DBMS. At present, the data models used in the database system are: Hierarchical model, network model and relational model. The fundamental difference between them is the way data is represented differently (that is, the type of contact between the records is different). A hierarchical model represents a relationship between data in a "tree structure". A mesh model is a "graph structure" that represents the connection between data.   A relational model is a "two-dimensional table" (or a relationship) that represents the connection between data. 1. Hierarchical Model (hierchical)

Hierarchical model is one of the earliest models used in database system, and its data structure is a "tree with direction". The root node is at the top, the highest level, the sub-nodes are under, arranged by layers. The hierarchical model is characterized by that there is only one node with no parent node, it is the root node, and the other nodes have only one parent node. The figure shows a hierarchical data model of the Department of Educational Administration, and figure (a) shows the linkages between entities, as shown in figure (b).

  

The most influential hierarchical model of DBS is the the late 1960s, IBM company launched the IMS Hierarchical model database system. 2. Network Model (Network)

The mesh model represents the connection between entities and entities in a mesh structure. Each node in the net represents a record type, which is implemented by linking pointers. The mesh model can represent the connection of multiple dependencies, or it can represent the intersection of data, that is, the horizontal relationship between the data and the vertical relationship, it is the extension of the hierarchical model. The mesh model can easily represent various types of connections, but the structure is complex and the algorithm is difficult to standardize. It is characterized by the ability to have more than one parent node for a node, and more than one node to have no parent node.

The following figure shows a Web data model for a Department of Educational administration.

3. Relational Model (Relation)

The relationship model is a two-dimensional table structure to represent the relationship between entities and entities, which is based on the relational mathematical theory. The data structure of a relational model is a collection of "two-dimensional table frames". Each two-dimensional table can also be called a relationship. In the relational model, both the object and the result of the operation are two-dimensional tables. The relational model is currently the most popular database model. The database management system supporting relational model is called relational database management system, and access is a relational database management system. The diagram shows a simple relational model in which figure (a) is shown as the relationship pattern, and figure (b) shows the relationship between the two relational models, the relationship name is the teacher relationship and the curriculum relationship, each relationship contains 3 tuples, and the main code is "teacher number".

The consistency of description not only describes the entity itself with relation, but also describes the relation between the entities, which can directly express many-to-many relations, the relationship must be a normalized relation, that is, each attribute is an irreducible data item, the table is not allowed, and the relational model is based on the mathematical concept, and has a strong theoretical basis.

In the relational model, the basic data structure is a two-dimensional table, without a link pointer like a hierarchy or mesh. The relationship between records is reflected by the attributes of the same name in different relationships. For example, to find the course of the "lecturer" teacher, you can first find the teacher number "1984030" in the teacher relationship, and then find the course name corresponding to the "1984030" instructor number in the course relationship. Through the above query process, the property teacher number with the same name plays a role in connecting two relationships. It can be seen that the relationship model should not be isolated, nor a random patchwork of two-dimensional table, it must meet the corresponding requirements.

A relationship is a two-dimensional table, a collection of tuples. A relational framework is a property name table for a relationship. Formal representations are:

  

where R is the relationship name, and Ai (I=1,2,...,n) is the property name of the relationship.

Relationships are implemented through public attributes. For example, the figure shows two relationships, and the association between the two relationships is achieved through the teacher number public property.

A relational database is a collection of all the relationships that correspond to a relational model. For example, in an educational management relationship database, including teacher relations, curriculum relations, student relations, classroom relations, performance relations and so on.

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.