DeepSource
Dashboard Resources Pricing Discover Directory Log in

Run your first analysis.

Find thousands of code security and quality issues in your codebase, before they end up in production.

Start now
All analyzers SQL
SQL

SQL

By DeepSource

Use Analyzer
Docs
Discuss
Duplicate table aliases SQL-L020
Anti-pattern
Critical

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

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.

Unused table alias SQL-L025
Anti-pattern
Major

Tables should not be aliased if that alias is not used. An usused alias makes code harder to read without changing any functionality.

Ambiguous use of DISTINCT SQL-L021
Anti-pattern
Major

Ambiguous use of DISTINCT in select statement with GROUP BY.

Subquery found in JOIN SQL-L042
Anti-pattern
Minor

JOIN clauses should not contain subqueries. Use Common Table Expression(CTE, aka WITH statement)s instead.

Unflattened CASE statements in ELSE clause SQL-L058
Anti-pattern
Minor

Nested CASE statement in ELSE clause could be flattened.

Unknown number of resulting columns SQL-L044
Anti-pattern
Minor

Queries that produce an unknown number of result columns are an anti-pattern.