Technically you can model anything in SQL including execution of any Turing complete language
Yes, but OP wants to preserve the relational goodness.
Yes, but OP wants to preserve the relational goodness.