simplifying the sql file