Simplify SQL generation