Relational data structures and formal definition:
Data structure of the relational model is very simple, containing only a single data structure - relationship
Linkages between real-world entities and entities are used to represent the relationship
- Formal definition of the relationship:
- Cartesian Product:
- Cartesian product can be expressed as a two-dimensional table
- Each row in the table corresponds to a tuple in a tuple values called component
- Each column in the table corresponds to a field
- Relationship: the relationship is a limited subset of the Cartesian product
- Related concepts:
- Domain: is a collection of values having the same data type
- Example: integer, real number, an integer in the range of a specified length string collection, { 'M', 'F'}, etc.
- Base: the number of different values of the fields allow a
- Properties: relationship of different columns are called attributes, each has a name
- Candidate code: If a set value of the property to be able to uniquely identify a tuple of the relation, is called the attribute group candidate code
- Full code: all the attributes of a group relationship model candidate code pattern of this relationship is referred to as full code
- Master code: if a relationship with a plurality of candidate codes, the selected one of the main code
- Main properties: such properties is referred to as the main properties of candidate code
- Non-primary property (attribute code phenanthrene): attribute is not included in any candidate code is referred to as non-primary property
- Domain: is a collection of values having the same data type
- Cartesian Product:
- Relationship Type:
- Lookup table: the query results corresponding table
- Table view: is derived from other tables or views substantially Table, a virtual table, does not correspond to the actual data stored
- Basic relationship (base table or the base table):
- nature:
- Column is homogeneous (Homogeneous), i.e., from the same property
- Different columns from the same domain, say where each attribute as a different attribute to give a different attribute name
- ,, order of the columns does not matter in any order of the columns can be exchanged
- Any two candidate code is not the same as the tuple of
- Row does not matter the order, the order may be arbitrarily exchanged row
- Component value must take atoms, i.e., each component is not sub-items (a basic condition specification)
- Column is homogeneous (Homogeneous), i.e., from the same property
- nature:
- Relational schema:
- Definition: relational schema type, the value of the relationship is the relationship schema is a description of the relationship
- Relational schema is a description of the relationship is static, stable
- Relationship is a mode state or the contents of shift time, is dynamic, changing with time
- Pointed out that the structure of the set of tuples relations
- Property constitute
- Property from the domain
- Image relationship between the attributes of the domain
- Set aside integrity constraints
- Formal definitions: R (U, D, DOM, F)
- R: Relationship name
- U: The composition of the relationship property name collection
- D: the U-attributes from the domain
- DOM: attribute set to the image domain
- F: the set of dependencies among attribute data
- Definition: relational schema type, the value of the relationship is the relationship schema is a description of the relationship
- relational database:
- Definitions: In the field of a given application, all the relationships constitutes a relational database
- Type and value:
- Type: relational database schema is a description of a relational database
- : The value set at a time corresponding to the relational model of the relationship
"Introduction to Data System (fifth edition)" - - Reference Renmin University - Wang Shan