Home >Database >SQL >What are the data structures used in relational database systems

What are the data structures used in relational database systems

王林
王林Original
2020-07-13 13:50:1020958browse

The data structure used in relational database systems is a two-dimensional table. In a relational database system, all data is represented by a two-dimensional table structure, and these two-dimensional tables are usually called relationships. In a relational database, each relationship is a two-dimensional table.

What are the data structures used in relational database systems

#The data structure used in relational database systems is a two-dimensional table.

(Recommended learning: mysql tutorial)

Analysis:

In a relational database system, all data adopts the structure of a two-dimensional table To represent, these two-dimensional tables are usually called relationships. In a relational database, each relationship is a two-dimensional table, and both the entity itself and the relationship between entities are represented by the two-dimensional table of "relationships".

Relationship model structure

1. Single data structure----relationship (table file). The table of a relational database uses a two-dimensional table to store data. It is a logical group with related information arranged in rows and columns. It is similar to an Excel worksheet. A database can contain any number of data tables.

From the user's perspective, the logical structure of a relational model is a two-dimensional table, consisting of rows and columns. This two-dimensional table is called a relationship. In layman's terms, a relationship corresponds to a table.

2. Tuple (record). A row in the table is a tuple, or a record.

3. Attributes (fields). Each column in the data table is called a field. The table is defined by the various fields it contains. Each field describes the meaning of the data it contains. The design of the data table is actually the design of the fields. When creating a data table, each field is assigned a data type, defining their data length and other properties. Fields can contain various characters, numbers, and even graphics.

4. Attribute value. The intersection of rows and columns represents a certain attribute value. For example, "Database Principles" is the attribute value of the course name

5 and the main code. The primary key (also called the primary key or primary key) is the data used to uniquely identify a tuple in the table. Keywords are used to ensure the uniqueness of records in a table. They can be one field or multiple fields and are often used as index fields of a table. The key of each record is different, so it can uniquely identify a record. The key is also called the primary key, or simply the primary key.

6. Domain. The value range of the attribute.

7. Relationship model. The description of relationships is called a relationship schema. The description of the relationship is generally expressed as: relationship name (attribute 1, attribute 2...attribute n).

But this simple data structure of the relational model can express rich semantics and describe entities in the real world and various relationships between entities.

The above is the detailed content of What are the data structures used in relational database systems. 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