The logical structure of data in a relational database is a two-dimensional table. Relational database tables use two-dimensional tables to store data, which are logical groups of related information arranged in rows and columns. A database can contain any number of data tables.
#The logical structure of data in a relational database is a two-dimensional table.
Related introduction:
Relational database is the mainstream of database applications. The data models of many database management systems are developed based on the relational data model.
Relationship model structure:
1. Single data structure----relationship (table file)
The tables of relational databases use two-dimensional tables to store data. A logical grouping of related information arranged in rows and columns, 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 what it contains. The meaning of data, the design of data tables is actually the design of fields.
When creating a data table, assign a data type to each field and define 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. Primary code
The primary key (also called primary key or primary keyword) is the data used to uniquely determine 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. The value range of the domain
attribute.
7. Relationship model
The description of the relationship is called the relationship model. The description of the relationship is generally expressed as: relationship name (attribute 1, attribute 2...attribute n). For example, the above relationship can be described as: course (course number, course name, credits, teacher).
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 is the logical structure of data in a relational database. For more information, please follow other related articles on the PHP Chinese website!