# SQL Review

> Review SQL and ORM queries for correctness, safety, and performance before they ship.

- Skill: `elitongadotti/sql-review` (Agent Skill)
- Install (CLI): `npx skillmds@latest add elitongadotti/sql-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/elitongadotti/sql-review/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: elitongadotti (https://skillmd.com/u/elitongadotti)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/elitongadotti/sql-review

---

# SQL Review
- **Injection** — parameterized, always. No string interpolation into SQL.
- **N+1** — a query inside a loop? Replace with a join or a batched IN.
- **Missing index** — does the WHERE/JOIN/ORDER BY hit an indexed column? If not, the table scan will surface at scale.
- **Unbounded** — SELECT with no LIMIT on a growing table; a JOIN that fans out rows.
- **Transactions** — multi-write operations wrapped so a partial failure can't corrupt state.
- **Migrations** — reversible (up AND down), and safe on a live table (no blocking lock on a hot table at peak).
Output: each issue with the line and the rewrite. Show the EXPLAIN if performance is the concern.

