# sql-pro

> Claude/Codex skill by [@jeffallan](https://omgskills.com/library/jeffallan/index.md) · 12k stars · Updated 2026-10-30

Optimizes SQL queries, designs database schemas, and troubleshoots performance issues. Use when a user asks why their query is slow, needs help writing complex joins or aggregations, mentions database performance issues, or wants to design or migrate a schema. Invoke for complex queries, window functions, CTEs, indexing strategies, query plan analysis, covering index creation, recursive queries, EXPLAIN/ANALYZE interpretation, before/after query benchmarking, or migrating queries between database dialects (PostgreSQL, MySQL, SQL Server, Oracle).

Tags: ai-agents, claude, claude-code, claude-marketplace, claude-skills

## Install

```sh
git clone https://github.com/Jeffallan/claude-skills /tmp/claude-skills && ln -s /tmp/claude-skills/skills/sql-pro ~/.claude/skills/sql-pro
```

## From README

SQL Pro Core Workflow Schema Analysis - Review database structure, indexes, query patterns, performance bottlenecks Design - Create set-based operations using CTEs, window functions, appropriate joins Optimize - Analyze execution plans, implement covering indexes, eliminate table scans Verify - Run EXPLAIN ANALYZE and confirm no sequential scans on large tables; if query does not meet sub-100ms target, iterate on index selection or query rewrite before proceeding Document - Provide query explanations, index rationale, performance metrics Reference Guide Load detailed guidance based on context: | Topic | Reference | Load When | |-------|-----------|-----------| | Query Patterns | references/query-patterns.md | JOINs, CTEs, subqueries, recursive queries | | Window Functions | references/window-functions.md | ROWNUMBER, RANK, LAG/LEAD, analytics | | Optimization | references/optimization.md | EXPLAIN plans, indexes, statistics, tuning | | Database Design | references/database-design.md...

## Links

- HTML page: https://omgskills.com/library/jeffallan/claude-skills/sql-pro/
- GitHub: https://github.com/Jeffallan/claude-skills
- Author: [@jeffallan](https://omgskills.com/library/jeffallan/index.md)

## More from this repo

- [api-designer](https://omgskills.com/library/jeffallan/claude-skills/api-designer/index.md) — Used when designing REST or GraphQL APIs, creating OpenAPI specifications, or planning API architecture.
   - [@jeffallan](https://omgskills.com/library/jeffallan/index.md) · 12k stars
- [architecture-designer](https://omgskills.com/library/jeffallan/claude-skills/architecture-designer/index.md) — Used when designing new high-level system architecture, reviewing existing designs, or making architectural decisions.
   - [@jeffallan](https://omgskills.com/library/jeffallan/index.md) · 12k stars
- [atlassian-mcp](https://omgskills.com/library/jeffallan/claude-skills/atlassian-mcp/index.md) — Integrates with Atlassian products to manage project tracking and documentation via MCP protocol.
   - [@jeffallan](https://omgskills.com/library/jeffallan/index.md) · 12k stars
