Algebraic operations of five basic relationships
Collection : Some specified sets of objects together become a collection in which each object is called an element.
The three characteristics of a set: certainty, reciprocity, and disorder.
(1) Certainty: Refers to a clear concept, the object description is clear, can not be vague, not ambiguous.
(2) Cross-anisotropy: for a given set, any two of its elements are different.
(3) Disorder: Given a set, the relationship between the elements in the set can be reversed and swapped.
Five basic relational operations: the difference, the Cartesian product, the projection, the choice.
We have learned the arithmetic of set: And, intersection, difference, seek complement set.
Relational algebra operations are similar to the operations of sets and are not identical. Especially in relation to position, the set is "disorder".
1. and (Union):
Relational algebra and Operation = = Set merging operations
Relationship R={a,b},s={b,c}
R∪S = {a,b,c}.
2. Difference (difference):
Relational algebra difference Operation = = Set difference operation
Relationship R and relationship S, if the difference operation is performed, the meiosis must be a subset of the meiosis.
Relationship R={a,b},s={b}
R-s = {A}.
3. Cartesian product (Extended Cartesian product):
This is a concept that is not in the previous set of learning.
The number of elements of the RxS equals the number of elements of the relationship R multiplied by the number of elements of the relationship S.
4. Projection (Projection):
Gets from the vertical direction.
πA = {A1,A2}
5. Select (Selection):
Gets from the horizontal direction.
σ Age >16 (R) = S
Summary: The introduction of the theory, the purpose is to convey a thought, to achieve an algorithm, so the process must be as simple as possible. Practice and reinforce in the example.
Citation: The three major characteristics of Yu Yingau set http://res.tongyi.com/resources/article/student/others/zt090318/zt/gz/sx/78.htm
Relational algebra operations