Home >Common Problem >What is the structure of most database management systems currently used?

What is the structure of most database management systems currently used?

青灯夜游
青灯夜游Original
2022-08-24 14:15:233401browse

Most of the structures of database management systems are "relational structures". The relationship structure is an unformatted structure that uses a single two-dimensional table structure to represent entities and the relationships between entities. The relational structure organizes data in the form of record groups or data tables to facilitate storage and transformation using the relationships between various entities and attributes. It does not have hierarchies or pointers. It is a way to establish the relationship between spatial data and attribute data. Very efficient way to organize data.

What is the structure of most database management systems currently used?

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

Most of the structures of database management systems currently used are "relational structures".

Relationship structure, also known as "relationship model", refers to a data model that expresses entities and relationships between entities in the form of a two-dimensional table.

Three basic data models have been produced in the data development process, which are hierarchical model, network model and relational model. These three models are named according to their data structures. The first two use formatted structures. In this type of structure, entities are represented by records, and records are abstracted as vertices of the graph. The connection between record types is abstracted as the connection arc between vertices. The entire data structure corresponds to the graph. The basic structure of the hierarchical model is a tree structure; the basic structure of the network model is an undirected graph without any restrictions. The relational model is an unformatted structure that uses a single two-dimensional table structure to represent entities and the relationships between entities. The relational model is a commonly used data model in current databases.

Relationship model: Organize data in the form of record groups or data tables to facilitate storage and transformation using the relationships between various entities and attributes. There is no hierarchy or pointers. It is a very effective data organization method to establish the relationship between spatial data and attribute data.

There are thirteen basic concepts and basic terms of the relational model. They are:

(1) Relationship: A relationship corresponds to a two-dimensional Table, two-dimensional table is the name of the relationship.

(2) Tuple: A row in a two-dimensional table is called a tuple.

(3) Attribute: Columns in a two-dimensional table are called attributes. The number of attributes is called the element or degree of the relationship. The value of the column is called the attribute value;

(4) (Value) Domain (Domain): The value range of the attribute value is the value domain.

(5) Component: The attribute value of the column corresponding to each row, that is, an attribute value in the tuple. [2]

(6) Relational schema: The row definition in the two-dimensional table, that is, the description of the relationship is called the relational schema. It is generally expressed as (attribute 1, attribute 2,..., attribute n). For example, the relationship model of a teacher can be expressed as a teacher (teacher number, name, gender, age, professional title, department).

(7) Key (code): If there is an attribute or set of attributes that uniquely identifies an entity in a relationship, it is called the key of the entity, that is, two keys in any relationship state of the relationship A tuple in which all combinations of values ​​on this attribute are different.

(8) Candidate key (candidate code): If the value of a certain attribute in the relationship can uniquely identify a tuple, if no attribute can be removed in a key of the relationship, otherwise it is not this The key of a relationship is called the specified candidate key as the candidate key or candidate code of the relationship.

For example, in the following student table, "student number" or "library card number" can uniquely identify a tuple, then "student number" and "library card number" can both uniquely identify a tuple, then Both "student number" and "library card number" can be used as candidate keys for student relationships.

##S3002李京女21B20050102foreign language##S4001
Student number
Name
Gender
Age
Library card number
Department
S3001
Zhang Ming
Male
##22
B20050101
foreign language
Zhao Li
21
B20050301
Management

In the course selection table, only the attribute group "student number" and "course number" can uniquely identify a tuple, then the candidate key is (student number, course Number).

Student ID
Course ID
S3001
C1
##S3001
C2
S3002
C1
S4001
C3
(8) Primary key (primary key): Specify a user among several candidate keys of a relationship To uniquely identify the tuple of the relationship, the specified candidate key is called the primary key, or simply the primary key, keyword, or primary key. Each relationship has one and only one primary key, usually a smaller combination of attributes is used as the primary key. For example, in the student table, if "student number" is selected as the basis for data operation, then "student number" is the primary key. In the course selection table, the primary key is (student number, course number).

(9) Primary attributes and non-primary attributes: The attributes included in any candidate key in the relationship are called primary attributes, and the attributes not included in any candidate key are non-primary attributes.

(10) Full key or full code: a collection of all attributes in a relational schema.

(11) Foreign key or foreign key: Although an attribute in a relationship is not the primary key of this relationship, or is only the primary key, but it is the primary key of another relationship, it is called a foreign key. Or foreign code.

(12) Super key or super code: If an attribute is removed from a key of a relationship and it is still the key of the relationship, such a key is called a super key or super code of the relationship.

(13) Reference relationship and referenced relationship: refers to two relationships that are related to each other by foreign keys and can be transformed into each other.

Three types of integrity rules for relational models

1. Entity integrity rules

This rule requires that the tuples in the relationship must be There cannot be a null value on the attribute. If there is a null value, the primary key value cannot uniquely identify the tuple.

2. Referential integrity rules

If the attribute set K is the primary key of the relationship schema R1, and K is also the foreign key of the relationship schema R2, then in the relationship R2, the value of K is only Two possibilities are allowed, either a null value, or equal to a primary key value in the R1 relationship.

  • When using, please note:

    a. The foreign key and the corresponding primary key can have different names, as long as they are defined in the same value range.

    b.R1 and R2 can also be the same relationship model, which represents the connection between attributes.

    c. Whether the foreign key value is allowed to be empty should depend on the specific problem.

3. User-defined integrity rules

This is a constraint for specific data, determined by the application environment.

Advantages of the relational model

(1) Single data structure

In the relational model, whether it is an entity or a connection between entities, Represented by relationships, each relationship corresponds to a two-dimensional data table, and the data structure is simple and clear.

(2) The relationship is standardized and established on a strict theoretical basis.

The basic norms that constitute the relationship require that each attribute in the relationship cannot be divided, and the relationship is established on a solid theoretical basis. based on strict mathematical concepts.

(3) Simple concept and easy operation

The biggest advantage of the relational model is its simplicity, which is easy for users to understand and master. A relationship is a two-dimensional table, and users only need to use simple query language. Able to operate the database.

For more related knowledge, please visit the

FAQ column!

The above is the detailed content of What is the structure of most database management systems currently used?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn