SQL cleanup

Use uppercase, span several lines to improve readability, use
implicit line continuation, invert quoting to avoid escaping.