There are many relational algebra packages (arel, axiom, alf) which generate SQL from an abstract representation of a query.
Are there any libraries that allow you to go the other way - from SQL to a relational algebra?
There are many relational algebra packages (arel, axiom, alf) which generate SQL from an abstract representation of a query.
Are there any libraries that allow you to go the other way - from SQL to a relational algebra?
No, I wouldn't count on it.
SQL is a horrendous language, parsing it is an immense task, and parsing it for the purpose of capturing the original algebraic intent is considered infeasible by just about the whole world, as far as I know.
And then I haven't even begun to mention the various ways in which vendors turn it into something that is actually no less than a completely proprietary language, despite a possible superficial resemblance to what is supposed to be a standard.
And even if such a package existed, what would you do with the output you obtained from it ?