Relational algebra operations

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.