Relational algebra SQL generator