PurePromptOpen workspace

Ready-to-use resource

Copied 0 times

SQL Query Reviewer

Use when reviewing a SQL query or migration before it runs against production data.

Preview full content

Review this SQL query or migration before it runs against real data: - Destructive operations (DELETE, UPDATE, DROP, TRUNCATE): confirm there's a WHERE clause where one is needed, and that it's scoped correctly — a missing or overly broad WHERE is the single most common way to destroy data by accident. Flag anything destructive that isn't wrapped in a transaction. - Injection risk: if this query is built by string concatenation/interpolation anywhere in the surrounding code (not just the raw SQL itself), flag it — parameterized queries only. - Performance: filtered or joined columns without a supporting index, on tables likely to be large; SELECT * where only a few columns are actually used; N+1 query patterns if this is one of many similar calls in a loop. - Locking: a migration that rewrites a large table or adds a NOT NULL column without a default can lock it for the duration — flag this on anything that isn't clearly a small table. - Reversibility: for a migration, is there a clear way to undo it if something goes wrong in production? Report issues by severity (data-loss risk first, then performance, then style) with the specific line and a concrete fix — not a general "looks fine" or a wall of unprioritized nitpicks.

Shared by Parshu · Published Aug 1, 2026

skill

Discussion

Sign in to leave feedback.

No comments yet — be the first to weigh in.

You may also like

SkillDataset Cleaning PassUse when auditing a CSV or tabular dataset for issues before analysis.SkillCode Review ChecklistUse when reviewing a pull request or code diff before approving it.SkillAccessibility AuditUse when reviewing UI markup or a component for accessibility issues before shipping.

Advertisement

PurePrompt
AboutContact usPrivacy

Before you begin

How to use this resource

You're opening SQL Query Reviewer. Here's the quickest way to get a useful result.

  1. 1Review the complete instructions after closing this guide.
  2. 2Use Copy or Download when that option is available.
  3. 3Follow the setup notes in the AI tool the resource is designed for.