关系代数和关系微积分都是形式查询语言。
关系代数:
关系代数是一种过程语言。在关系代数中,顺序指定了必须执行的操作。在关系代数框架中创建来实现查询。关系代数中包含的基本运算是:
1. Select (σ)
2. Project (Π)
3. Union (U)
4. Set Difference (-)
5. Cartesian product (X)
6. Rename (ρ)
关系演算:
关系微积分是正式的查询语言。它也被称为声明性语言。在关系演算中,没有指定必须执行运算的顺序。关系演算意味着我们必须获得什么结果。
关系微积分有两种变体:
- 元组关系演算 (TRC)
- 领域关系演算 (DRC)
关系微积分表示为:
{ t | P(t) }
Where,
t: the set of tuples
p: is the condition which is true for the given set of tuples.
关系代数和关系微积分的区别:
S.NO | Relational Algebra | Relational Calculus |
---|---|---|
1. | It is a Procedural language. | While Relational Calculus is Declarative language. |
2. | Relational Algebra means how to obtain the result. | While Relational Calculus means what result we have to obtain. |
3. | In Relational Algebra, The order is specified in which the operations have to be performed. | While in Relational Calculus, The order is not specified. |
4. | Relational Algebra is independent on domain. | While Relation Calculus can be a domain dependent. |
5. | Relational Algebra is nearer to a programming language. | While Relational Calculus is not nearer to programming language. |