Transform SQL statements