Tidy SQL code to avoid extra commits