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 )
    Database System - 4th theory class :	Formal	Relational Query Languages (2) 20/03/23

  • 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:”
    Database System - 4th theory class :	Formal	Relational Query Languages (2) 20/03/23
    Database System - 4th theory class :	Formal	Relational Query Languages (2) 20/03/23
    Database System - 4th theory class :	Formal	Relational Query Languages (2) 20/03/23
    Database System - 4th theory class :	Formal	Relational Query Languages (2) 20/03/23

Database Theory Tuple relational calculus

Database System - 4th theory class :	Formal	Relational Query Languages (2) 20/03/23
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
    Database System - 4th theory class :	Formal	Relational Query Languages (2) 20/03/23 ≡P is true “for all” tuples t in relation R