SQL

SQL

Made by DeepSource
Unnecessary whitespace found SQL-L039
Style
Minor

Whitespace should be limited to a single space unless while indenting or preceding a comment.

Unnecessary trailing whitespace SQL-L001
Style
Minor

Trailing whitespace is any spaces or tabs after the last non-whitespace character on the line until the newline.

Mixed Tabs and Spaces in single whitespace SQL-L002
Style
Minor

A single section of whitespace contains both tabs and spaces.

Table aliasing in FROM and JOIN operators SQL-L031
Style
Minor

Avoid table aliases in FROM clauses and JOIN conditions, as it’s harder to understand what the table called “c” is compared to “customers”.

Confusing use of USING operator SQL-L032
Style
Minor

Prefer specifying JOIN of keys instead of relying on USING operator. Certain warehouses have inconsistencies in USING results (specifically Snowflake).

File start with ' ' or other whitespace SQL-L050
Style
Minor

Files must not begin with newlines or whitespace.

Unqualified use of JOIN clause SQL-L051
Style
Minor

JOIN clauses should be fully qualified.

Files must end with a trailing newline SQL-L009
Style
Minor

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 detected SQL-L014
Style
Major

Inconsistent capitalization found for unquoted identifiers. All keywords should be of same case to maintain consistency.

Line too long SQL-L016
Style
Minor

Line length of the SQL statement exceeds the defined limit. This includes - Maximum line length allowed.

Inconsistent function names SQL-L030
Style
Minor

Inconsistent capitalisation of function names.

Indentation not consistent with previous lines SQL-L003
Style
Minor

Operators placed before the newline SQL-L007
Style
Minor

Operators near newlines should be placed after, not before the newline.

Duplicate table aliases SQL-L020
Anti-pattern
Critical

Table aliases should be unique within each clause. It is recommended to name the aliases differently.

Missing whitespace after a comma SQL-L008
Style
Minor

Commas should be followed by a single whitespace unless followed by a comment.

Inconsistent capitalisation of keywords SQL-L010
Style
Major

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 detected SQL-L011
Style
Major

Implicit aliasing of table not allowed. Use explicit AS clause.

Implicit aliasing of column detected SQL-L012
Style
Major

Implicit aliasing of column not allowed. Use explicit AS clause.

Column expression without alias detected SQL-L013
Anti-pattern
Major

It is recommended to use explicit AS clause for column expressions.

DISTINCT with parenthesis SQL-L015
Anti-pattern
Major

Parenthesis are not needed and confuse DISTINCT with a function. The parethesis can also be misleading in which columns they apply to.