博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
oracle中dbms_DBMS中的关系演算
阅读量:2528 次
发布时间:2019-05-11

本文共 3379 字,大约阅读时间需要 11 分钟。

oracle中dbms

Relational calculus uses variable, the formula for state and it has the same expressive power. There is two type of Relational calculus:

关系演算使用变量,状态公式,并且具有相同的表达能力关系演算有两种类型:

  1. Tuple relational calculus

    元组关系演算

  2. Domain relational calculus

    领域关系演算

1)元组关系演算 (1) Tuple relational calculus)

It is also known as predicate calculus. Tuple (t) variable range for all tuple of relation or table (R).

它也称为谓词演算。 关系或表(R)的所有元组的元组(t)可变范围。

t.A --> Column ‘A’ of tuple ‘t’

tA->元组't'的列'A'

Basic form: { T | P ( T ) } where, T is variable and P(T) is formula to fetch true tuple.

基本形式:{T | P(T)} ,其中T是变量,而P(T)是提取真实元组的公式。

Like: { t.A1, t.A2 … t.Ai | θ }

像:{t.A1,t.A2…t.Ai | θ}

where, t.A1, t.A2 ... t.Ai is predicate calculus expression and θ is condition.

其中, t.A1,t.A2 ... t.Ai是谓词演算表达式,θ是条件。

Let, we have a table name Student [ R.No, Name, D.No, Gender ]

让我们有一个表名Student [R.No,Name,D.No,Gender]

Example: - Find R.No and Name of all student in D.No is 2.

示例:-查找R.No,D.No中所有学生的姓名为2。

{ t.R.No, t.Name | t ϵ Student (Student(t)) ^ t.D.N0 = 2 }

{tRNo,t.Name | t ϵ学生(学生(t))^ tDN0 = 2}

Relational calculus uses variables, constant, comparison operators ( ==, >, =, <=, != ), logical operators (˅ , ˄) and quantifiers ( Ǝ, ᵿ ).

关系演算使用变量,常量,比较运算符(==,>,=,<=,!=),逻辑运算符(˅,˄)和量词(Ǝ,ᵿ)。

Quantifier:

量词:

Condition is expressed by use quantifier with a tuple variable. Two type of quantifiers is there Ǝ (there exists), ᵿ (for all) .

条件是通过使用带元组变量的量词来表示的。 (存在)有两种类型的量词,(全部)。

Like: -

喜欢: -

  • Ǝt (variable) -> R(θ(t)) (relation and condition)

    Ǝt(变量)-> R(θ(t))(关系和条件)

  • ᵿt (variable) -> R(θ(t)) (relation and condition)

    ᵿt(变量)-> R(θ(t))(关系和条件)

  1. there exists a tuple in ‘t’ (set of tuple) in relation ‘R’ such that ‘θ’ predicate condition is true.

    关系“ R”中的“ t”(元组集合)中存在一个元组,使得“θ”谓词条件为真。

  2. Θ(t) is true for all tuple in ‘t’ in relation ‘R’.

    对于关系“ R”中“ t”中的所有元组,Θ(t)是正确的。

Variable uses: Free tuple (no quantifier use), use quantifier in bound expression.

变量使用:自由元组(不使用量词),在绑定表达式中使用量词。

Example: List all the employee name who have no manager.

示例:列出所有没有经理的员工姓名。

{ t.name | t ϵ emp ( Ǝ emp) ˄ manager = ‘NULL’ }

{t.name | t ϵ emp(Ǝemp)˄管理器='NULL'}

2)领域关系演算 (2) Domain relational calculus)

Domain (d (attribute)) variable range for all domain (columns) of relation or table (R). It is similar work on all the domains (columns) as tuple relational calculus work for all row.

关系或表(R)的所有域(列)的域(d(属性))变量范围。 它在所有域(列)上都是类似的工作,就像元组关系演算在所有行上一样。

Basic form: { D | P ( D ) } where, D is variable and P(D) is formula to fetch true domain.

基本形式:{D | P(D)} ,其中D是变量,P(D)是获取真实域的公式。

Like: { d.A1, d.A2 … d.Ai | θ }

像:{d.A1,d.A2…d.Ai | θ}

where, d.A1, d.A2 ... d.Ai is domain calculus expression and θ is condition.

其中, d.A1,d.A2 ... d.Ai是域演算表达式,θ是条件。

Let, we have a table name Student [ R.No, Name, D.No, gender ]

让我们有一个表名Student [R.No,Name,D.No,female]

Example: - Find R.No and Name of all student in D.No is 2.

示例:-查找R.No,D.No中所有学生的姓名为2。

{ d.R.No, d.Name, d.D.No, d.gender | d ϵ Student (Student(d)) ^ d.D.N0 = 2 }

{dRNo,d.Name,dDNo,d.gender | d ϵ学生(学生(d))^ dDN0 = 2}

Conclusion

结论

In this article, we have learned about what is relation calculus and its different types with example? I hope you all clear the concept. Stay tuned for the next article, we will discuss more it in the upcoming articles. Have a nice day! Happy Learning!

在本文中,我们通过示例了解了什么是关系演算及其不同类型? 希望大家都明白这个概念。 请继续关注下一篇文章,我们将在以后的文章中讨论更多内容。 祝你今天愉快! 学习愉快!

翻译自:

oracle中dbms

转载地址:http://ubvzd.baihongyu.com/

你可能感兴趣的文章
java中long类型转换为int类型
查看>>
Viewbox在UWP开发中的应用
查看>>
给你的应用“一只”智慧的眼睛 —— Barcode常识普及以及识别信息处理
查看>>
PHP基础知识点汇总(三)
查看>>
排序算法
查看>>
sql server系统数据库,temp库的用途
查看>>
推荐一下干货-------为什么你的app不耐看
查看>>
05-数据类型转换
查看>>
[BZOJ1934/Luogu2057][SHOI2007]Vote 善意的投票 题解
查看>>
lightslider-支持移动触摸的轻量级jQuery幻灯片插件
查看>>
如何用纯 CSS 创作一个 3D 文字跑马灯特效
查看>>
assert.notDeepEqual()
查看>>
android获取textview的行数
查看>>
winsocket客户端编程以及jmeter外部调用
查看>>
PHP基础知识------页面静态化
查看>>
zoj 3747 dp递推
查看>>
POJ 3740
查看>>
41025 ISD Assignment 2 Autumn 2019
查看>>
JavaScript跨域调用基于JSON的RESTful API
查看>>
js 右击事件
查看>>