Traditional Culture Encyclopedia - Traditional culture - Specialized relational operations include

Specialized relational operations include

Specialized relational operations include selection operations, projection operations, and join operations.

I. The relational operations of a database include:

1. Selection operation, which selects all tuples from a relation R that satisfy a given condition;

2. Projection operation, which selects certain specified attributes from all attributes of a relation R;

3, Connection operation, which is to form a new relation by selecting tuples that satisfy certain conditions between attributes from the generalized Cartesian product of two relations.

Two, the traditional set operations

1, and (UNION) has two relations R and S, which have the same structure. and of R and S is a set of tuples belonging to R or belonging to S. The operator is ∪. Noted as T = R ∪ S.

2, the difference (DIFFERENCE) R and S of the difference is a set of tuples belonging to R but not S, the operator is -. Noted as T=R-S.

3, intersection (INTERSECTION) R and S intersection is a set of tuples belonging to both R and S. The operator is ∩. Noted as T = R ∩ S. R ∩ S = R - (R - S).

Three, Division Operations

1.In relational algebra, the division operation can be understood as the inverse of the Cartesian product.

2. Let the division relation R be m-tuple, and the division relation S be n-tuple, then their quotient is m-n-tuple, which is written as R ÷ S. The principle of composition of the quotient is: the m-n columns in the division relation R are divided into a number of groups according to their values, and the set of n-columns of values of each group is checked to see whether it contains the division relation S, and if it does, then it takes the values of the m-n columns as a tuple of the quotient, or else it doesn't take it.