Relation Algebra

类别:数据库 点击:0 评论:0 推荐:
分两大类:
1。SET-THEORETIC OPERATIONS

NAME                              SYMBOL        KEYBOARD FORM              CHE
UNION                                                        UNION                                 并                                         INTERSECT                                                                                              交
DIFFERENCE                        -                        MINUS                             差
//前三类是要条件的,就像矩阵运算一样
条件:大概意思是 狗只能跟狗比,不能跟猫比
PRODUCT                             *                      TIMES                                笛卡儿积 
2。NATIVE RELATIONAL OPERATIONS

PROJECT                           R[]                            R[]                                  取其中几列
SELECT                              R WHERE C            R WHERE C                  就像SQL中的select  * from C 一样
JOIN                                                                    JOIN                             合并:所有“共有列”一样的record才保留
DIVISION                           /                                DIVIDBY                      除以
//  If the table R is defined by R = T*S,then it is true that T = R DIVIDBY S.

EXAMPLE 2.96(表格跟见上篇文章)
0 := ORDERS    --alias
GET cids of customers who order all products that anybody orders.This is division again,and the divisor,the list of “all” products,must be projected from ORDERS rather than PRODUCTS.
0[cid,pid]/0[pid]

本文地址:http://com.8s8s.com/it/it19753.htm