Get the latest tech news
SQL style guide by Simon Holywell
A consistent code style guide for SQL to ensure legible and maintainable projects
The following suffixes have a universal meaning ensuring the columns can be read and understood easily from SQL code. This forms a river down the middle making it easy for the readers eye to scan over the code and separate the keywords from the implementation detail. Sometimes it will make sense to have the closing parenthesis on a new line at the same character position as its opening partner—this is especially true where you have nested subqueries.
Or read this on Hacker News