数据库知识点SQL极简教程 · MySQL · MyBatis · JPA 技术笔记 教程 总结oracle的基本sql介绍

Relational Algebra

2017-12-18  本文已影响1人  jin2017

Generally, the result of a relational algebra operation is a new relation.

Unary operations

Unary operations include selection and projection.

Selection could return a new relation consisting of certain rows of the selected relation.

Predicate F is a logical expression, indicating the criteria of selection.

Selection

F = X θ Y, with
X and Y being attributes, constants, simple functions, and
θ standing for relational operators >, >=, <, <=, =, or !=.

Also, F could use logical operators AND, OR, NOT to connect sub-predicates.

Projection could return columns satisfying predicate criteria F.

Projection
Binary operations

Join operation selects rows from Cartesian product of two relations.

Theta join:
Join two relations under predicate F (with θ operation).
Or say,
select rows from Cartesian product with predicate F.

Equi-join:
Theta join with the θ being "=".
Two relations have same values on certain columns.

Natural join:
Special Equi-join.
Two relations have same attribute and join together after eliminate one duplicate column.

上一篇 下一篇

猜你喜欢

热点阅读