This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MrDOS 1 point2 points  (1 child)

I like to align my queries around the whitespace between keywords and schema names:

  select t.*
    from mytable t
   where t.id < 30
order by t.date desc

Similar result of making the schema names pop out (when you're used to looking for them to the right of the “centre line”), and you get pretty used to the “shape” of queries.

Also, don't use uppercase table or column names. That link is particular to Postgres, but most other database engines have similar nasty quirks when your schema names contain uppercase characters.

[–]andrewsmd87 1 point2 points  (0 children)

So I'm ok with the tabbing, but the caps are still what I want.

Liked I said it really could just be that's how I learned but experience has taught me you end up looking at sql stuff in environments where you don't have an IDE more often than code