PEP8 fixes for SQL longlines
Remove lists and extra loops