First page Back Continue Last page Graphics
Translating algebra to tupel calculus
Step 1: reduce the algebra expression to the basic operators
Step 2: if E is a single relation r then E translates to { t | tr } or if r has attributes B1, ...,Bn then it can also be written as {t | sr ( t[B1]=s[B1] ... t[Bn]=s[Bn] ) }
Step 3, apply the following substeps recursively (if the algebra expressions are base relations an may need to be added):
- Renaming: let { t | f(t) } be a tc expression equivalent to an ra expression E that uses attributes B1, ...,Bn; let E1 = x(A1,...,An)(E) then the translation to tc is { s | tr (f(t) s[A1]=t[B1] ... s[An]=t[Bn]) }
Notes: