sql-query-explainer
Explains, optimises, writes, and documents SQL queries. Use when asked to explain a SQL query, optimise slow SQL, translate SQL to plain English for non-technical stakeholders, write a query from a natural language description, or produce query documentation. Produces plain-English explanations, annotated optimised queries, or a data dictionary covering output shape, assumptions, and known limitations. Works across PostgreSQL, MySQL, BigQuery, Snowflake, and standard SQL.
npx skills add mohitagw15856/pm-claude-skills --skill sql-query-explainer --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# SQL Query Explainer Skill This skill explains SQL queries in plain language, identifies optimisation opportunities, and helps communicate data logic to non-technical stakeholders. It also writes and documents new queries from natural language descriptions. ## Required Inputs - **The SQL** (Explain/Optimise/Document modes) — the actual query, ideally with the dialect named (Postgres, BigQuery, Snowflake, MySQL…); dialect changes both semantics and the optimisation advice. - **The intent in plain words** (Write mode) — what question the data should answer, plus table/column names if known. Without a schema, assumptions get stated, never silently invented. - Optional but transformative: `EXPLAIN`/`EXPLAIN ANALYZE` output and rough table sizes — turns generic advice into advice about *your* query plan. ## Modes Detect which mode the user needs based on their request: 1. **Explain** — Translate existing SQL into plain English 2. **Optimise** — Review SQL for performance issues and suggest improvements 3. **Write** — Generate SQL from a natural language description 4. **Document** — Produce a data dictionary or query documentation --- ## Mode 1: Explain When given a SQL query, produce:
- Required Inputs
- Modes
- Mode 1: Explain
- Plain English Summary
- Step-by-Step Walkthrough
- What the Result Looks Like
- Potential Issues to Flag
- Mode 2: Optimise
- Performance Assessment
- Issues Found
- Optimisation Checklist
- Mode 3: Write
- Mode 4: Document
- Query Documentation
What does the sql-query-explainer skill do?
Explains, optimises, writes, and documents SQL queries. Use when asked to explain a SQL query, optimise slow SQL, translate SQL to plain English for non-technical stakeholders, write a query from a natural language description, or produce query documentation. Produces plain-English explanations, annotated optimised queries, or a data dictionary covering output shape, assumptions, and known limitations. Works across PostgreSQL, MySQL, BigQuery, Snowflake, and standard SQL.
How do I install it?
Run `npx skills add mohitagw15856/pm-claude-skills --skill sql-query-explainer --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From mohitagw15856/pm-claude-skills, a repository with 1,255 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
