TST: restructure sql tests

- add some explanation of structure of tests
- general clean-up (some pep8, docstrings, etc)
- move some methods to _TestSQLAlchemy
- use standard quoting for sqlite
Merge pull request #6912 from jorisvandenbossche/sql-tests

TST: restructure sql tests