Outline: A single data structure: Relationships
Two, relational operation: relational algebra language; relational calculus language; SQL
III. integrity constraints: Entities, references, user customizations
I. Integrity constraints
1. Entity integrity: The individual components of the main attribute cannot be null values
2. Referential integrity: The outer code is either empty or equal to the primary code value in the referenced relational table
3. User-defined Integrity
Second, relational algebra
A) Traditional set operations:
1. and
2. and
3. Poor
4. Generalized Cartesian product
(ii) Specialized relational operations
1. Select σ: The tuple of the approved conditions in the relationship R; σsage<20 (Student) selects sage<20 rows from Student
2. Projection π: Select several columns from the relationship R as a new relationship πsname,sdept (Student) Choose sname columns and sdept columns from Student as a new table
3. Connect ∞
1) General Connection
2) Equivalent connection
3) Natural Connection: You need to remove duplicates and speak the same part of the two groups
4. Difference ÷
2 relational database