# convert domain relational calculus with two same tuples to relational algebra

Given two relations $R(A, B)$ and $S(A, C)$.

I can understand the early part is the projection of attribute $A$ from $S$, which could be written as $π_a(S)$, but later part is confusing and not understandable to me.

$$\{a| (\exists c) (S(ac)) \land (\exists b_1) (\exists b_2) ( R(ab_1) \land R(cb_2) \land b_1 > b_2 ) \}$$

Can anyone help me understand it? and how to convert this domain relational calculus to its relational algebra?

• Your intuition on projection is correct. An expression alike {bc | (∃ a) R(ab) ∧ S(ac)} is basically a join on attribute A between R and S. Conjunction are typically captured by selection or intersection. As an hint, you can try to parse the expression, then to say it loud in English, and finally to translate the English sentence into a relational expression – Romuald Sep 11 '14 at 12:57
• For R.a = S.c, when R.b is bigger(or the maximum?), print S.a? – canoe Sep 11 '14 at 14:27