
SQL Pro
Optimize slow SQL queries, design schemas, and convert queries between database dialects.
- Repository
- Jeffallan/claude-skills
- Stars
- 12,176
- Licence
- MIT
- Files
- 6 files
What it does
This skill gives an AI agent a set of SQL guidelines and reference notes so it can help when a database query is slow, when you need a complex query with joins, CTEs or window functions, or when you are designing or migrating a database schema. It steers the agent toward reading execution plans (EXPLAIN ANALYZE), suggesting covering indexes, and writing set-based queries, and it covers PostgreSQL, MySQL, SQL Server and Oracle differences. The skill itself runs no code; it shapes the agent's advice and SQL output.
Great for
- Developers debugging a slow PostgreSQL or MySQL query who want a structured plan-reading and indexing approach
- Analysts writing multi-step reports with window functions, CTEs or recursive queries
- Engineers porting a query from one database engine (e.g. SQL Server) to another
Skip it if
- Running changes against a production database without review: the skill advises on SQL but does not test it, and it recommends running EXPLAIN ANALYZE, which actually executes the query and can be costly on large tables
- Non-SQL databases such as document or key-value stores, where the advice would not apply
- Users expecting guaranteed performance numbers: the sub-100ms target and benchmarks must be verified against their own data
Try asking
- “Why is this query taking 40 seconds? Here is the EXPLAIN output: ...”
- “Rewrite this correlated subquery as a join and suggest a covering index”
- “Convert this T-SQL stored query to PostgreSQL syntax”
- “Design a normalized schema for an orders, customers and products system”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 6 original files, the MIT licence and an attribution note.
sql-pro.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip sql-pro.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip sql-pro.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Paste the actual EXPLAIN ANALYZE output and your table sizes so the agent can ground its advice in real numbers.
- Name your database engine and version up front, since the skill's advice differs between PostgreSQL, MySQL, SQL Server and Oracle.
- Always test suggested indexes and rewritten queries on a staging copy with production-like data before deploying.
What's inside
- references/database-design.md
- references/dialect-differences.md
- references/optimization.md
- references/query-patterns.md
- references/window-functions.md
- SKILL.md
Redistributed unmodified from Jeffallan/claude-skills under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.