Traditional Culture Encyclopedia - Traditional festivals - Specialized relational operation
Specialized relational operation
The related operations of the database include:
1, select operation, and select all tuples satisfying given conditions from a relation r;
2. Projection operation, that is, selecting some designated attributes from all the attributes of a relation R;
3. The join operation is to select tuples between attributes that meet certain conditions from the generalized Cartesian product of two relations to form a new relationship.
Traditional set operation:
1 and UNION have two relations, R and S, which have the same structure. The union of R and S is a set of tuples belonging to R or S, and the operator is ∨. Write t = r ∪ s.
2. The difference between R and S is a set of tuples belonging to R but not S, and the operator is-. Write it down as t = r-s.
3. Intersection The intersection of R and S is a set of tuples belonging to both R and S, and the operator is ∩. Write it as t = r ∩ s. R∩S=R-(R-S).
Division operation:
1. In relational algebra, division can be understood as the inverse of cartesian product.
2. Let the division relation R be an m-ary relation and the division relation S be an n-ary relation, then their quotient is an m-n-ary relation, which is denoted as R \s S. The principle of forming quotient is: divide the m-n columns in the division relation R into several groups according to their values, and check whether the set of values of n columns in each group contains the division relation S, if so, take the values of m-n columns as tuples of quotient, otherwise, do not take them.
Relational operation is the most basic operation in relational algebra, including selection, projection, union, intersection, difference set and Cartesian product. In addition to these basic operations, there are other extended relational operations:
1. natural connection: natural connection is a connection operation between two relationships. Based on the common attributes between two relationships, it automatically matches these attributes and returns all matching rows.
2. Relationship division: Relationship division is to select some columns from a relationship to generate a new relationship, in which the new relationship contains all the values in the second relationship that match the selected columns.
3. View: View is a virtual relationship, which is defined by relational algebraic expressions. Its content does not actually exist in the database, but is generated by query statements.
4.Union: Union is a binary operation between two relationships, which combines the two relationships into a new relationship, including all rows of the source relationship.
5. Link: Link is a binary operation used to combine the lines of two relationships into a new relationship. These extended relational operations can enhance the expressive ability of relational algebra, make it more flexible and suitable for more practical applications.
- Previous article:How to make steamed bread with yeast dough?
- Next article:Western tea culture
- Related articles
- Traditional enterprise community management
- What does Jiangsu Li Fei Supply Chain Management Co., Ltd. sell?
- Who knows the name of this English song? ! ! -(200 points)
- Please describe the uniforms of today's world football powers!
- Help translate a few words of English, it's urgent, thank you! ! !
- What are the basic dances of Bali Dance?
- What is the significance of cultural innovation?
- Emotional virtualization: the advantages and disadvantages of online dating and online dating, how to face the increasingly virtual emotional communication?
- Do I need to read Li Zhongguang's Basics of Music Theory and A Concise Course of Basics of Music Theory at the same time when I study music theory by myself? Which is more suitable to choose first?
- The traditional stone-grabbing game is back.