3 ms·
Relational algebra is functional programming: you map-reduce your way to a solution set. Relational calculus is logical programming: you specify what the solut
by garmaine 6y ago
Relational algebra is functional programming: you map-reduce your way to a solution set.
Relational calculus is logical programming: you specify what the solution looks like and the query engine figures out the sequence of operations to find a solution.
- anyfoo 6y agoA useful analogy indeed, thanks.
- garmaine 6y agoIt goes a bit deeper than an analogy, but regardless I’m glad it helped! EDIT: To explain, the relational algebra IS a map-reduce functional programming language. The relational calculus IS a logical programming language. They just use tuples and sets instead of the more familiar lists and strings of LISP, Forth, Prolog, etc. And the sibling comment further up is right to point out that there are mechanical transformations to turn one into the other, just like there are automatic ways to compile Prolog into LISP (and vice-versa, though that is rarely done).