Database System - 4th theory class : Formal Relational Query Languages (2) 20/03/23

[經過長時期的鹹魚之旅我決定翻下身系列]

  • Relation algebra(8) : Division
    Notation : R ÷ S
    R = ( A1 , … , Am , B1 , … , Bn )
    S = ( B1 , … , Bn )
    S 含於 R
    R - S = ( A1 , … , Am )
    R ÷ S = { t | t ∈ }

  • Outer-Join
    An extension of the join operation that avoids loss of information.
    Computes the join and then adds tuples from one relation that does not match tuples in the other relation to the result of the join.
    Uses null values: null signifies that the value is unknown or does not
    “EXAMPLES:”
    1
    2
    3
    4

Database Theory Tuple relational calculus

5
The calculus formulas in above curly braces are the examples of Tuple relational calculus .
Tuple relational calculus was based on predicate calculus in the Mathematical Logic .

Tuple relational calculus: A non-procedural query language a logical language, where each query is of the form
{t| P(t ) } 
It is the set of all tuples t such that predicate P is true for t .
t is a tuple variable , t [A] denotes the value of tuple ton attribute A
t ∈ R denotes that t is in relation R
P is a formula similar to that of the predicate calculus

Predicate Calculus Formula

  1. Set of attributes and constants
  2. Set of comparison operators: e.g., ≤, <, ≥,>, =, ≠
  3. Set of connectives: and ^, or v‚ not
  4. Set of quantifiers:
    ョt ∈ R ( P ( t ) ) ≡ “there exists” a tuple in t in relation R such that predicate P t is true
    1 ≡P is true “for all” tuples t in relation R
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章