SQL: Simplify and unify style for all tests

This hopefully makes the test conditions more readable and helps
avoiding mistakes when modifying them.

(I suggest you use something like `PAGER="less -x4" git diff -w` if you want to only review the actual code changes, as there are quite a few space changes mixed in)