sql-pro

sql-pro is a skill for Claude Code from Jeffallan/claude-skills. It costs 115 tokens per session (1,240 once invoked), scanned A, original, MIT.

A coding guide for SQL, the language used to read and change data in relational databases. It covers query writing, database structure, indexes, and checking why queries take too long.

In plain words
What is it for?
Use it to write joins and grouped reports, use common table expressions and window functions, design or migrate schemas, compare database-specific SQL, and inspect query execution plans.
Why use it?
It helps find slow database operations and choose clearer queries, indexes, and table designs instead of guessing at the cause.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the fullstack-dev-skills plugin — 71 skills, 2 commands, 8 agents, 4 hooks shipped together

Good fit Use it to write joins and grouped reports, use common table expressions and window functions, design or migrate schemas, compare database-specific SQL, and inspect query execution plans.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jeffallan/claude-skills/sql-pro
About the project

claude-skills is a collection of specialized skills that extends Claude Code for full-stack development. Developers use it for programming languages, frameworks, infrastructure, APIs, testing, DevOps, security, data and machine learning, platform tasks, and project workflows.

Jeffallan/claude-skills · 12,556 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Jeffallan/claude-skills --skill sql-pro
Clone the repo
git clone --depth 1 https://github.com/Jeffallan/claude-skills

Made for: Claude Code.

Or install fullstack-dev-skills, the plugin that ships this one along with the rest of its 71 skills, 2 commands, 8 agents, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sql-pro

README.md
[![agentmods](https://agentmods.dev/badge/skills/jeffallan/claude-skills/sql-pro/github.svg)](https://agentmods.dev/skills/jeffallan/claude-skills/sql-pro)
Your own site
<a href="https://agentmods.dev/skills/jeffallan/claude-skills/sql-pro"><img src="https://agentmods.dev/badge/skills/jeffallan/claude-skills/sql-pro/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sql-pro

Your own site · 80×15
<a href="https://agentmods.dev/skills/jeffallan/claude-skills/sql-pro"><img src="https://agentmods.dev/badge/skills/jeffallan/claude-skills/sql-pro.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,240 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 3 Oct 2026
  • Snyk pass 3 Oct 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00115 $0.01240
Opus 5.5 $0.00046 $0.00496
Sonnet 5.5 $0.00023 $0.00248
Haiku 4.5 $0.00012 $0.00124

Measured 1mo ago against content hash c2916129aa56, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sql-pro scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • sql-pro — 92% identical, 5 lines differ
plugin/skills/sql-pro/SKILL.md · 135 lines

How it starts

The opening of the file, as written. The whole thing — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SQL Pro

Core Workflow

  1. Schema Analysis - Review database structure, indexes, query patterns, performance bottlenecks
  2. Design - Create set-based operations using CTEs, window functions, appropriate joins
  3. Optimize - Analyze execution plans, implement covering indexes, eliminate table scans
  4. 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
  5. 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 ROW_NUMBER, RANK, LAG/LEAD, analytics
Optimization references/optimization.md EXPLAIN plans, indexes, statistics, tuning
Database Design references/database-design.md Normalization, keys, constraints, schemas
Dialect Differences references/dialect-differences.md PostgreSQL vs MySQL vs SQL Server specifics

Quick-Reference Examples

CTE Pattern

-- Isolate expensive subquery logic for reuse and readability
WITH ranked_orders AS (
    SELECT
        customer_id,
        order_id,
        total_amount,
        ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date DESC) AS rn
    FROM orders
    WHERE status = 'completed'          -- filter early, before the join
)
SELECT customer_id, order_id, total_amount
FROM ranked_orders
WHERE rn = 1;                           -- latest completed order per customer

Window Function Pattern

-- Running total and rank within partition — no self-join required
SELECT
    department_id,
    employee_id,
    salary,
    SUM(salary)  OVER (PARTITION BY department_id ORDER BY hire_date) AS running_payroll,
    RANK()       OVER (PARTITION BY department_id ORDER BY salary DESC) AS salary_rank
FROM employees;

Read the full file on GitHub · 135 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +3 lines c2916129aa56
  2. 3mo ago First seen · 132 lines · 115 tokens per session scan A 88ee296bc482

Subscribe to this mod's changes

sql-pro is a skill published in the GitHub repository Jeffallan/claude-skills (12,556 stars, last pushed today), licensed MIT. It adds 115 tokens to every session and 1,240 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

sql-pro compared with skills from other repositories

sql-pro next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
sql-proJeffallan/claude-skillsSkill13ktodayMITA115Claude Code
postgres-database-migrationtimescale/pg-aiguideSkill1.9kyesterdayApache-2.0A220Cursor
timescaledb-hyperfunctionstimescale/pg-aiguideSkill1.9kyesterdayApache-2.0A298Cursor
design-postgis-tablestimescale/pg-aiguideSkill1.9kyesterdayApache-2.0A31Cursor
setup-timescaledb-hypertablestimescale/pg-aiguideSkill1.9kyesterdayApache-2.0A219Cursor
migrate-postgres-tables-to-hypertablestimescale/pg-aiguideSkill1.9kyesterdayApache-2.0A181Cursor
pgvector-semantic-searchtimescale/pg-aiguideSkill1.9kyesterdayApache-2.0A190Cursor