A DELETE with no WHERE deletes every row — and it passes code review
The most dangerous line in most codebases is not exotic. It is DELETE FROM products; — a cleanup script that looks harmless, passes review, and wipes a table the day it runs against the wrong database. The same goes for SELECT * FROM orders CROSS JOIN customers; , which pairs every row with every row before anyone notices the report has 300 billion rows.
I built a free skill that catches these before production does: SQL Query Smell Detector.
TL;DR
Hand it a JSON file of queries (or a plain .sql file). A stdlib-only Python script runs deterministic static checks — destructive statements, cartesian joins, index killers, unbounded scans, implicit joins, OR across columns, DISTINCT band-aids — and emits a severity-ranked findings report with a concrete fix per finding. A second script validates the report.…