SQL: Simplify and unify style for all tests

This hopefully makes the test conditions more readable and helps
avoiding mistakes when modifying them.