# 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 )

• 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 Theory Tuple relational calculus

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
≡P is true “for all” tuples t in relation R