2.1 Relational data structure and formal definition
Relational database system is a database system that supports relational model.
The relational model consists of three parts: relational data structure, relational operation set and relationship integrity constraint.
2.1.1 Relationship
The data structure of the relational model is very simple and contains only a single data structure-----relationship.
1. Domain: A collection of values that have a system data type
2. Cartesian product:
For example, a={a,b},b={0,1,2}, the axb={<a,o>,<a,1>,<a,2>,<b,0>,<b,1>,<b,2>,}<a,0 > is a tuple
A is a component
3. The relationship:<a,0> is called the relationship on the domain a*b, the number of a*b subsets is called the goal or the degree.
n = 1 The relationship is called a cell relationship
n = 2 The relationship is called a two-tuple relationship
A relationship is a two-dimensional table, with each column corresponding to a name, called a property.
An attribute group that uniquely identifies a tuple is called a candidate code.
If there are multiple candidates in the relationship, select one of the main codes.
The properties of the candidate code are called main attributes, others are called non-primary or non-code attributes.
In the simplest case, the candidate code contains only one attribute, in extreme cases all attributes are candidate codes, called full yards.
There are three types of relationships:
Basic relationship (base table or base table): Is the actual table, and he is the logical representation of the actual stored data.
Query table: The table that corresponds to the query result
View chart: A table that is exported by a base table or other icon, which is a virtual table
2.1.2 Relationship Mode
Relationship is actually a two-dimensional table, the description of the relationship is called the relationship pattern.
A relationship is the state or content of a relationship pattern at a certain point in time. Relationship patterns are static, stable, and relationships are dynamic, changing over time
2.1.3 Relational database
Relational databases include:
Definition of several domains
Several relationship patterns defined on these domains
The value of a relational database is the set of relationships that these relational patterns correspond to at some point, often referred to as relational databases.
"Introduction to Database System"----relational database (i)