In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about the meaning of the relational data model, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Relational data model is a kind of data model, which models data in the form of relation or table. It is used to represent the storage and processing of data in relational database, and the data will be stored in relational database in the form of relational table.
There are three elements in the relational data model: relational data structure, relational integrity constraints and relational operations. Let's take a brief look at it.
Relational data structure:
The relational model represents the database as a collection of relationships (the logical structure of the data in the relational model is a two-dimensional table). Let's look at some of the main structural concepts:
1. Table
In the relational data model, relationships are saved in tabular form. It stores relationships between entities and has rows and columns, where rows represent records and columns represent sets of values for specific attributes. Example:
2. Tuple
A row of a table, and the single record that contains the relationship is called a tuple. Use "cardinality" to indicate the number of tuples, for example: the cardinality of the student relationship defined above is 4 (there are 4 records).
3. Attributes
The attributes of the relationship are defined, for example, name and age are all attributes of students. The total number of attributes in a relationship is called the relationship "degree". For example, the degree of the student relationship defined above is 4.
4. Relationship model
The relationship schema describes the relationship name (table name), attribute and its name. If a schema has multiple relationships, it is called a relational schema.
5. Relationship examples
A set of finite element groups in a relational database system represents a relational instance. The relationship instance has no duplicate tuples.
6. Key key
Each row has one or more attributes, called relational keys, that uniquely identify rows in the relationship (table).
7. Attribute domain
Each attribute has a predefined range of values called attribute fields.
Integrity constraints of a relationship
Every relationship must have some conditions to make it valid, and these conditions are called relational integrity constraints, and there are three main integrity constraints, let's take a look at:
1. Key constraints
There must be at least one minimum subset of attributes in the relationship, which uniquely identifies the tuple. This smallest subset of attributes is called the key of the relationship. If there are multiple such minimum subsets, these subsets are called candidate keys.
Key limitation
1) in the relationship with the key property, no two tuples can have the same key property value.
2) the key attribute cannot have a null value.
Description: key constraints are also known as solid constraints.
2. Domain constraints
Property has a specific value in the actual scene. For example, age can only be a positive integer. An attempt has been made to apply the same constraints to the properties of the relationship. Each attribute must have a specific range of values. For example, the age cannot be less than zero and the phone number cannot contain a number other than 0-9.
3. Referential integrity constraints
Referential integrity constraints indicate that if a relationship references a key attribute of a different or the same relationship, the key element must exist. It applies to the concept of foreign keys. Foreign keys are key attributes of relationships that can be referenced in other relationships.
Relationship operations:
Relationship operations mainly include: query, insert, delete, update and other operations.
After reading the above, do you have any further understanding of what the relational data model means? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.