SQL Expert
aiskillstore/marketplace
Expert SQL query writing, optimization, and database schema design with support for PostgreSQL, MySQL, SQLite, and SQL Server.
Translate natural language to SQL, optimize query performance, and interpret EXPLAIN plans for SQLite and PostgreSQL.
$ npx skills add zebbern/claude-code-guide --skill sql-insight -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install zebbern/claude-code-guide sql-insight --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/zebbern/claude-code-guide.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/sql-insight .claude/skills/sql-insight && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "sql-insight" agent skill from https://github.com/zebbern/claude-code-guide/tree/main/skills/sql-insight into .claude/skills/sql-insight/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-insight", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/zebbern/claude-code-guide/tree/main/skills/sql-insightType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add zebbern/claude-code-guide --skill sql-insight -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install zebbern/claude-code-guide sql-insight --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zebbern/claude-code-guide.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/sql-insight .agents/skills/sql-insight && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "sql-insight" agent skill from https://github.com/zebbern/claude-code-guide/tree/main/skills/sql-insight into .agents/skills/sql-insight/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-insight", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add zebbern/claude-code-guide --skill sql-insight -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install zebbern/claude-code-guide sql-insight --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zebbern/claude-code-guide.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/sql-insight .cursor/skills/sql-insight && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "sql-insight" agent skill from https://github.com/zebbern/claude-code-guide/tree/main/skills/sql-insight into .cursor/skills/sql-insight/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-insight", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/zebbern/claude-code-guide.git --path skills/sql-insight--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add zebbern/claude-code-guide --skill sql-insight -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install zebbern/claude-code-guide sql-insight --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zebbern/claude-code-guide.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/sql-insight .gemini/skills/sql-insight && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "sql-insight" agent skill from https://github.com/zebbern/claude-code-guide/tree/main/skills/sql-insight into .gemini/skills/sql-insight/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-insight", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install zebbern/claude-code-guide sql-insightInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add zebbern/claude-code-guide --skill sql-insight -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/zebbern/claude-code-guide.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/sql-insight .github/skills/sql-insight && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "sql-insight" agent skill from https://github.com/zebbern/claude-code-guide/tree/main/skills/sql-insight into .github/skills/sql-insight/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-insight", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add zebbern/claude-code-guide --skill sql-insight -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install zebbern/claude-code-guide sql-insight --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zebbern/claude-code-guide.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/sql-insight .opencode/skills/sql-insight && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "sql-insight" agent skill from https://github.com/zebbern/claude-code-guide/tree/main/skills/sql-insight into .opencode/skills/sql-insight/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-insight", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
sql-insightTranslate natural language to SQL, optimize query performance, and interpret EXPLAIN plans for SQLite and PostgreSQL.
SQL Insight is an agent skill from zebbern/claude-code-guide. Translate natural language to SQL, optimize query performance, and interpret EXPLAIN plans for SQLite and PostgreSQL. Triggered when users ask to convert questions into SQL, improve slow queries, tune indexes, analyze execution plans, or mention keywords like NL2SQL, query tuning, or full table scan.
Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including scripts (for example `scripts/sql_query_helper.py`).
It sits in Databases, covering Query optimization and SQL. It works with SQL, SQLite and PostgreSQL. The repository describes itself as: Claude Code Guide - Setup, Commands, workflows, agents, skills & tips-n-tricks from beginner to power user! The licence is MIT.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 4698e3b. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
python3pipFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
SQL Insight loads about 2.1k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 530 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from zebbern/claude-code-guide at commit 4698e3b, republished under its MIT licence (© zebbern). 530 words, ~2,107 tokens.
.claude/skills/sql-insight/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.SQL query assistant — natural language to SQL translation, query optimization analysis, and EXPLAIN plan interpretation.
| Feature | Description |
|---|---|
| Schema Extraction | Extracts database table structure (columns, types, indexes, foreign keys, sample data) to provide context for NL→SQL |
| Natural Language → SQL | Translates natural language descriptions into SQL queries using schema context |
| Query Optimization Analysis | Detects SQL anti-patterns based on 13 rules and provides optimization suggestions |
| EXPLAIN Interpretation | Runs EXPLAIN and interprets the query plan, identifying full table scans, missing indexes, and more |
schema command to extract the database table structureoptimize command to check if the generated SQL can be improvedexplain command to verify the query execution plan# Step 1: Extract schema (compact mode, suitable for LLM context)
python3 scripts/sql_query_helper.py --db-path data.db schema --compact
# Step 2: Analyze SQL optimization suggestions
python3 scripts/sql_query_helper.py optimize "SELECT * FROM orders WHERE user_id = 100"
# Step 3: View EXPLAIN execution plan
python3 scripts/sql_query_helper.py --db-path data.db explain "SELECT * FROM orders WHERE user_id = 100"# Extract full schema (JSON format, with sample data)
python3 scripts/sql_query_helper.py --db-path data.db schema
# Compact mode (plain text, suitable for embedding in prompts)
python3 scripts/sql_query_helper.py --db-path data.db schema --compact
# Skip data sampling
python3 scripts/sql_query_helper.py --db-path data.db schema --sample-rows 0
# PostgreSQL
python3 scripts/sql_query_helper.py --db-type postgres --dsn "host=localhost dbname=mydb user=reader" schema --compact# Analyze SQL query (no database connection required, pure rule-based detection)
python3 scripts/sql_query_helper.py optimize "SELECT * FROM orders o, users u WHERE o.user_id = u.id"
python3 scripts/sql_query_helper.py optimize "SELECT name FROM users WHERE UPPER(email) LIKE '%@GMAIL.COM'"
python3 scripts/sql_query_helper.py optimize "SELECT id, (SELECT COUNT(*) FROM orders WHERE user_id = u.id) AS order_count FROM users u"# SQLite EXPLAIN
python3 scripts/sql_query_helper.py --db-path data.db explain "SELECT * FROM orders WHERE user_id = 100"
# PostgreSQL EXPLAIN
python3 scripts/sql_query_helper.py --db-type postgres --dsn "host=localhost dbname=mydb" explain "SELECT * FROM orders WHERE user_id = 100"
# PostgreSQL EXPLAIN ANALYZE (actually executes the query for real-world data)
python3 scripts/sql_query_helper.py --db-type postgres --dsn "host=localhost dbname=mydb" explain --analyze "SELECT * FROM orders WHERE user_id = 100"| Parameter | Required | Default | Description |
|---|---|---|---|
--db-type | No | sqlite | Database type: sqlite or postgres |
--db-path | For schema/explain (SQLite) | — | SQLite database file path |
--dsn | For schema/explain (PostgreSQL) | — | PostgreSQL connection string |
| Command | Requires Database | Description |
|---|---|---|
schema | Yes | Extract database table structure |
optimize <sql> | No | SQL query optimization analysis (pure rule-based detection) |
explain <sql> | Yes | Run EXPLAIN and interpret the plan |
| Parameter | Default | Description |
|---|---|---|
--sample-rows, -n | 3 | Number of sample rows per table (0 to skip sampling) |
--compact | false | Compact text output (suitable for embedding in prompts) |
| Parameter | Default | Description |
|---|---|---|
--analyze | false | Use EXPLAIN ANALYZE (PostgreSQL only; actually executes the query) |
The optimize command detects the following 13 SQL anti-patterns:
| Rule | Severity | Description |
|---|---|---|
| avoid-select-star | warning | Avoid SELECT *; explicitly list column names |
| unbounded-query | info | Missing WHERE and LIMIT clauses |
| leading-wildcard-like | warning | LIKE '%...' causes index to be bypassed |
| or-condition | info | OR conditions may prevent index usage |
| not-in-subquery | warning | NOT IN (subquery) has poor performance |
| scalar-subquery | warning | Scalar subqueries in SELECT execute row-by-row |
| function-on-column | warning | Functions on columns in WHERE prevent index usage |
| implicit-join | info | Implicit joins (comma-separated tables) are less readable |
| distinct-usage | info | DISTINCT may mask JOIN duplication issues |
| order-without-limit | info | ORDER BY without LIMIT |
| deep-nesting | warning | Deeply nested subqueries |
| having-without-group | warning | HAVING without GROUP BY |
| not-equal-filter | info | != conditions cannot effectively use indexes |
| Check | Applicable Database | Description |
|---|---|---|
| Full table scan | SQLite / PostgreSQL | Detects Seq Scan / SCAN TABLE |
| Auto temporary index | SQLite | SQLite auto-creates a temporary index, indicating a missing permanent index |
| Covering index | SQLite / PostgreSQL | Index contains all queried columns; no table lookup needed |
| Disk sort | PostgreSQL | Sort operation spills to disk |
| Nested loop join | PostgreSQL | Nested loop joins on large tables have poor performance |
| Row estimate deviation | PostgreSQL (ANALYZE) | Estimated rows differ from actual rows by more than 10x |
-- Database: sqlite
-- users (1500 rows): id INTEGER PK, name TEXT, email TEXT, age INTEGER, created_at TEXT
-- IDX(unique): idx_users_email on (email)
-- orders (8200 rows): id INTEGER PK, user_id INTEGER, amount REAL, status TEXT, created_at TEXT
-- FK: user_id -> users.id
-- IDX: idx_orders_user_id on (user_id){
"sql": "SELECT * FROM orders o, users u WHERE o.user_id = u.id",
"issues": [
{
"severity": "warning",
"rule": "avoid-select-star",
"message": "Avoid SELECT *: only select the columns you need to reduce I/O and network transfer",
"suggestion": "Replace SELECT * with an explicit list of required column names"
},
{
"severity": "info",
"rule": "implicit-join",
"message": "Uses implicit join (comma-separated tables), which is less readable and error-prone",
"suggestion": "Use explicit JOIN ... ON syntax for better readability and maintainability"
}
]
}{
"db_type": "sqlite",
"query": "SELECT * FROM orders WHERE user_id = 100",
"plan": [
{"id": 2, "parent": 0, "detail": "SEARCH orders USING INDEX idx_orders_user_id (user_id=?)"}
],
"interpretation": [
{
"severity": "ok",
"type": "index-search",
"detail": "Index lookup: idx_orders_user_id",
"suggestion": "Index lookup is efficient"
}
]
}?mode=ro; PostgreSQL uses SET SESSION READ ONLYsqlite3 is a built-in module)pip install psycopg2-binaryoptimize command requires no database connection and has zero external dependencies© zebbern, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (scripts) in skills/sql-insight of zebbern/claude-code-guide.
Open the folder on GitHubat commit 4698e3b
SQL Insight next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| SQL Insight this skillzebbern/claude-code-guide | 4.6k | — | ~2.1k | Automated safety check: Pass | MIT | |
| SQL Expertaiskillstore/marketplace | 430 | — | ~3.4k | Automated safety check: Pass | None | |
| SQL ToolkitLeoYeAI/openclaw-master-skills | 2.2k | — | ~3k | Automated safety check: Pass | MIT | |
| SQL Database Support for pRESTprest/prest | 4.6k | — | ~1.6k | Automated safety check: Pass | MIT | |
| PostgreSQL Documentation Reference2025Emma/vibe-coding-cn | 23k | 1 repos | ~19k | Automated safety check: Pass | MIT | |
| Squixeduardofuncao/squix | 273 | — | ~784 | Automated safety check: Pass | MIT |
aiskillstore/marketplace
Expert SQL query writing, optimization, and database schema design with support for PostgreSQL, MySQL, SQLite, and SQL Server.
LeoYeAI/openclaw-master-skills
Query, design, migrate, and optimize SQL databases. An agent skill from LeoYeAI/openclaw-master-skills.
prest/prest
Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.
2025Emma/vibe-coding-cn
PostgreSQL database documentation - SQL queries, database design, administration, performance tuning, and advanced features. Use when working with PostgreSQL…
eduardofuncao/squix
Run SQL queries across databases (Postgres, MySQL, SQLite, etc.) via the squix CLI.
unxed/f4
Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…
zebbern/claude-code-guide
This skill should be used when setting up, auditing, or enforcing internationalization/localization in UI codebases (React/TS, i18next or similar, JSON locales), including installing/configuring the…
zebbern/claude-code-guide
Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export.
zebbern/claude-code-guide
Generate publication-quality PNG chart images from data, supporting line, bar, area, candlestick, pie, and heatmap charts.
zebbern/claude-code-guide
Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts.
zebbern/claude-code-guide
Scan code for security issues: dependency vulnerabilities (npm/pip audit), secret leaks (regex and entropy analysis), and OWASP anti-patterns like SQL injection, XSS, or command injection.
zebbern/claude-code-guide
Generate self-contained HTML/SVG infographics from JSON data, including stat cards, bar charts, flow diagrams, and mixed dashboards.
Works with
Categories
Translate natural language to SQL, optimize query performance, and interpret EXPLAIN plans for SQLite and PostgreSQL. SQL Insight is an agent skill from zebbern/claude-code-guide. Translate natural language to SQL, optimize query performance, and interpret EXPLAIN plans for SQLite and PostgreSQL.
SQL Insight fits situations like: tasks that involve Query optimization; tasks that involve SQL.
Run `npx skills add zebbern/claude-code-guide --skill sql-insight -a claude-code`. Or copy the skill folder (skills/sql-insight in zebbern/claude-code-guide) into .claude/skills/sql-insight in your project. Claude Code loads it when a task matches its description.
Run `npx skills add zebbern/claude-code-guide --skill sql-insight -a codex`. Or copy the skill folder (skills/sql-insight in zebbern/claude-code-guide) into .agents/skills/sql-insight in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zebbern/claude-code-guide --skill sql-insight -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sql-insight, .gemini/skills/sql-insight, .github/skills/sql-insight and .opencode/skills/sql-insight in your project.
Going by SKILL.md and its folder, SQL Insight needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and pip). Our summary lists: Python 3.
SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
SQL Insight is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.1k tokens (SKILL.md is roughly 8.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with SQL Insight: SQL Expert (aiskillstore/marketplace, 430 stars), SQL Toolkit (LeoYeAI/openclaw-master-skills, 2.2k stars), SQL Database Support for pREST (prest/prest, 4.6k stars) and PostgreSQL Documentation Reference (2025Emma/vibe-coding-cn, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
zebbern (a GitHub user) maintains it in zebbern/claude-code-guide, which has 4,648 GitHub stars. The repository holds 46 skills in this directory. The repository was last updated on October 7, 2026.
Source: zebbern/claude-code-guide on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.