l The relationalalgebra is procedural(过程化) query language
Aset of operations, take one or two limited relations asinput and produce a new limited relation as output.
Three types of operations/operators on relations
l fundamentaloperations(基本运算)
l additiveoperations(附加运算)
l extendedoperations(扩展运算)
六种基本操作:
l select(选择): σ 相当于在横向上对每个元组根据某个条件进行一个选择,相当于SQL:where
l project(投影): ∏ 在纵向上根据某个条件对属性进行选择,其中重复的元组(行)会自动被去除。SQL:select
l union(并): ∪ 在做并操作时,两个关系的属性(列)应该是相同的。 SQL:intersect
l set difference(差): — 两个集合做差 SQL:except
l Cartesianproduct(笛卡尔积): × SQL:R1,R2(R1、R2是两个关系)
l rename(重命名): p (拉丁字符) SQL: as
Select Operation(σ):
Relationr:
σA=B ^ D > 5 (r)