Whitespace should be limited to a single space unless while indenting or preceding a comment.
Trailing whitespace is any spaces or tabs after the last non-whitespace character on the line until the newline.
A single section of whitespace contains both tabs and spaces.
Avoid table aliases in
FROM clauses and
JOIN conditions, as it’s harder to understand what the table called “c” is compared to “customers”.
JOIN of keys instead of relying on
USING operator. Certain warehouses have inconsistencies in
USING results (specifically Snowflake).
Files must not begin with newlines or whitespace.
JOIN clauses should be fully qualified.
Each file should end with a trailing newline. Ref: https://unix.stackexchange.com/questions/18743/whats-the-point-in-adding-a-new-line-to-the-end-of-a-file
Inconsistent capitalization found for unquoted identifiers. All keywords should be of same case to maintain consistency.
Line length of the SQL statement exceeds the defined limit. This includes - Maximum line length allowed.
Inconsistent capitalisation of function names.
Operators near newlines should be placed after, not before the newline.
Table aliases should be unique within each clause. It is recommended to name the aliases differently.
Commas should be followed by a single whitespace unless followed by a comment.
All keywords should be of same case to maintain consistency. The defaults can be configured per your needs with the following parameters.
Implicit aliasing of table not allowed. Use explicit
Implicit aliasing of column not allowed. Use explicit
It is recommended to use explicit
AS clause for column expressions.
DISTINCTwith parenthesis SQL-L015
Parenthesis are not needed and confuse
DISTINCT with a function. The parethesis can also be misleading in which columns they apply to.