Agent skill

SQL Queries

by phuryn in phuryn/pm-skills

Generate SQL queries from natural language descriptions. An agent skill from phuryn/pm-skills.

MITAuto-check passedDatabases

Install SQL Queries

skills CLI
$ npx skills add phuryn/pm-skills --skill sql-queries -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install phuryn/pm-skills sql-queries --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/phuryn/pm-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/pm-data-analytics/skills/sql-queries .claude/skills/sql-queries && rm -rf skills-src

Use ~/.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/

Facts

Skill name
sql-queries
GitHub stars
27k
Token cost
~907 tokens
SKILL.md length
356 words
Files
1
Skills in repo
62
Repo updated
First seen
Licence
MIT

At a glance

Generate SQL queries from natural language descriptions. An agent skill from phuryn/pm-skills.

  • Works in 4 steps: Understand Your Database Schema → Process Your Request → Generate Optimized Query → …
  • Building data reports
  • SKILL.md covers Purpose, How It Works, Usage Examples and Key Capabilities, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

SQL Queries is an agent skill from phuryn/pm-skills. Generate SQL queries from natural language descriptions. Supports BigQuery, PostgreSQL, MySQL, and other dialects. Reads database schemas from uploaded diagrams or documentation. Use when writing SQL, building data reports, exploring databases, or translating business questions into queries.

Its SKILL.md is about 910 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering SQL, Data warehousing and Database schema design. It works with SQL, Google BigQuery, MySQL and PostgreSQL. The repository describes itself as: PM Skills Marketplace: 100+ agentic skills, commands, and plugins — from discovery to strategy, execution, launch, and growth. The licence is MIT.

When your agent uses it

  • Building data reports
  • Exploring databases
  • Translating business questions into queries

Example prompts

  • “/sql-queries”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Understand Your Database Schema
  2. Process Your Request
  3. Generate Optimized Query
  4. Explain and Test

What it can do on your machine

Read from SKILL.md and the folder at commit 8607e3b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • productcompass.pm

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

SQL Queries loads about 907 tokens when it runs. Until then it costs about 76 tokens; SKILL.md has 356 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~76
When it runs · the whole SKILL.md, loaded when a task matches
~907

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.

Safety

Auto-check passed

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from phuryn/pm-skills at commit 8607e3b, republished under its MIT licence (© phuryn). 356 words, ~907 tokens.

Download SKILL.mdSave it as .claude/skills/sql-queries/SKILL.md (or your agent's skills folder).
name
sql-queries
description
Generate SQL queries from natural language descriptions. Supports BigQuery, PostgreSQL, MySQL, and other dialects. Reads database schemas from uploaded diagrams or documentation. Use when writing SQL, building data reports, exploring databases, or translating business questions into queries.

SQL Query Generator

Purpose

Transform natural language requirements into optimized SQL queries across multiple database platforms. This skill helps product managers, analysts, and engineers generate accurate queries without manual syntax work.

How It Works

Step 1: Understand Your Database Schema
  • If you provide a schema file (SQL, documentation, or diagram description), I will read and analyze it
  • Extract table names, column definitions, data types, and relationships
  • Identify primary keys, foreign keys, and indexing strategies
Step 2: Process Your Request
  • Clarify the exact data you need to retrieve or analyze
  • Confirm the SQL dialect (BigQuery, PostgreSQL, MySQL, Snowflake, etc.)
  • Ask for any additional requirements (filters, aggregations, sorting)
Step 3: Generate Optimized Query
  • Write efficient SQL that leverages your database structure
  • Include comments explaining complex logic
  • Add performance considerations for large datasets
  • Provide alternative approaches if applicable
Step 4: Explain and Test
  • Explain the query logic in plain English
  • Suggest how to test or validate results
  • Offer tips for performance optimization
  • If you want, generate a test script or sample data

Usage Examples

Example 1: Query from Schema File

Upload your database_schema.sql file and say:
"Generate a query to find users who signed up in the last 30 days
and had at least 5 active sessions"

Example 2: Query from Diagram Description

"Here's my database: Users table (id, email, created_at), Sessions table
(id, user_id, timestamp, duration). Generate a query for average session
duration per user in January 2026."

Example 3: Complex Analysis Query

"Create a BigQuery query to analyze our revenue by region and customer tier,
including year-over-year growth rates."
Show full SKILL.md (168 more words)Show less

Key Capabilities

  • Multi-Dialect Support: Works with BigQuery, PostgreSQL, MySQL, Snowflake, SQL Server
  • File Reading: Reads schema files, SQL dumps, and data documentation
  • Query Optimization: Suggests indexes, partitioning, and performance improvements
  • Explanation: Breaks down queries for learning and documentation
  • Testing: Can generate test queries and sample data scripts
  • Script Execution: Create executable SQL scripts for your database

Tips for Best Results

  1. Provide context: Share your database schema or structure
  2. Be specific: Clearly describe what data you need and any filters
  3. Mention database: Specify which SQL dialect you're using
  4. Include constraints: Mention data volume, time ranges, and performance needs
  5. Request format: Ask for the query result format if you need specific output

Output Format

You'll receive:

  • SQL Query: Production-ready SQL code with comments
  • Explanation: What the query does and how it works
  • Performance Notes: Optimization tips and considerations
  • Test Script (if requested): Sample data and validation queries

Further Reading

© phuryn, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in pm-data-analytics/skills/sql-queries of phuryn/pm-skills.

Open the folder on GitHubat commit 8607e3b

Compare with similar skills

SQL Queries 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.

SQL Queries compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
SQL Queries this skillphuryn/pm-skills27k—~907Automated safety check: PassMIT
SQL Querieskillvxk/pm-skills-zh167—~423Automated safety check: PassMIT
Agent SQL Proxiaoyuge886/aigc198—~315Automated safety check: PassMIT
SQL Query Explainermohitagw15856/pm-claude-skills1.4k—~1.6kAutomated safety check: PassMIT
Chdb SQLvemetric/vemetric3941 repos~1.2kAutomated safety check: PassApache-2.0
Golang Databaseunxed/f42402 repos~2.9kAutomated safety check: PassMIT

Similar skills

  • SQL Queries

    killvxk/pm-skills-zh

    将自然语言描述转化为 SQL 查询语句。支持 BigQuery、PostgreSQL、MySQL 及其他方言。可从上传的结构图或文档中读取数据库结构。适用于编写 SQL、构建数据报表、探查数据库,或将业务问题转化为查询语句。

    167 GitHub stars~423 tokensUpdated 6 mo ago
    DatabasesAuto-check passed
  • Agent SQL Pro

    xiaoyuge886/aigc

    Expert SQL developer specializing in complex query optimization, database design, and performance tuning across PostgreSQL, MySQL, SQL Server, and Oracle.

    198 GitHub stars~315 tokensUpdated 2 mo ago
    DatabasesAuto-check passed
  • SQL Query Explainer

    mohitagw15856/pm-claude-skills

    Explains, optimises, writes, and documents SQL queries. An agent skill from mohitagw15856/pm-claude-skills.

    1.4k GitHub stars~1.6k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Chdb SQL

    vemetric/vemetric

    A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…

    394 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed
  • Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…

    240 GitHub starsUsed in 2 repos~2.9k tokens
    DatabasesAuto-check passed
  • Semantic Analyst

    sidequery/sidemantic

    Answer analytical, KPI, metric, trend, cohort, and business-performance questions through a Sidemantic semantic layer.

    129 GitHub stars~982 tokensUpdated today
    DatabasesAuto-check passed

More from phuryn/pm-skills

All 62 skills in this repo
  • Reviews a diff by anchoring on agreements between two sides of a boundary, forcing a concrete violating execution, and refuting each finding before reporting it.

    27k GitHub stars~3.6k tokensUpdated 22 days ago
    Auto-check passed
  • A/B Test Analysis

    phuryn/pm-skills

    Validates an experiment's setup, works out lift, p-value and confidence interval from A/B test data, and recommends whether to ship, extend or stop.

    27k GitHub stars~893 tokensUpdated 22 days ago
    Auto-check passed
  • Team OKR Brainstorm

    phuryn/pm-skills

    Drafts three alternative sets of team OKRs, each with an inspiring objective and measurable key results, tied to the company strategy you provide.

    27k GitHub stars~1.1k tokensUpdated 22 days ago
    Auto-check passed
  • Analyzes uploaded cohort data to compute retention curves and feature adoption trends, builds heatmaps and charts, and suggests qualitative follow-up research.

    27k GitHub stars~1.3k tokensUpdated 22 days ago
    Auto-check passed
  • Dummy Dataset Generator

    phuryn/pm-skills

    Generates realistic test datasets with custom columns, row counts and business constraints, output as CSV, JSON, SQL inserts or a runnable Python script.

    27k GitHub stars~983 tokensUpdated 22 days ago
    Auto-check passed
  • Grammar and Flow Checker

    phuryn/pm-skills

    Reviews a draft for grammar, logic and flow problems and returns located, prioritized fix suggestions without rewriting the whole text.

    27k GitHub stars~2.4k tokensUpdated 22 days ago
    Auto-check passed

Categories

Questions about SQL Queries

What does SQL Queries do?

Generate SQL queries from natural language descriptions. An agent skill from phuryn/pm-skills. SQL Queries is an agent skill from phuryn/pm-skills. Generate SQL queries from natural language descriptions.

When should I use SQL Queries?

SQL Queries fits situations like: building data reports; exploring databases; translating business questions into queries.

How do I install SQL Queries in Claude Code?

Run `npx skills add phuryn/pm-skills --skill sql-queries -a claude-code`. Or copy the skill folder (pm-data-analytics/skills/sql-queries in phuryn/pm-skills) into .claude/skills/sql-queries in your project. Claude Code loads it when a task matches its description.

How do I install SQL Queries in Codex?

Run `npx skills add phuryn/pm-skills --skill sql-queries -a codex`. Or copy the skill folder (pm-data-analytics/skills/sql-queries in phuryn/pm-skills) into .agents/skills/sql-queries in your project. Codex loads it when a task matches its description.

Can I use SQL Queries in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add phuryn/pm-skills --skill sql-queries -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-queries, .gemini/skills/sql-queries, .github/skills/sql-queries and .opencode/skills/sql-queries in your project.

What does SQL Queries need to run?

SKILL.md names no scripts, command-line tools or credentials: SQL Queries is instructions for the agent only.

Does SQL Queries access the network?

SKILL.md names 1 domain. As links in the text: productcompass.pm. This is read from the text; nothing was executed.

Is SQL Queries safe to install?

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. Review the folder before installing.

What licence does SQL Queries use?

SQL Queries is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does SQL Queries use?

About 907 tokens (SKILL.md is roughly 3.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to SQL Queries?

Skills that share tags, products or a category with SQL Queries: SQL Queries (killvxk/pm-skills-zh, 167 stars), Agent SQL Pro (xiaoyuge886/aigc, 198 stars), SQL Query Explainer (mohitagw15856/pm-claude-skills, 1.4k stars) and Chdb SQL (vemetric/vemetric, 394 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains SQL Queries?

phuryn (a GitHub user) maintains it in phuryn/pm-skills, which has 26,809 GitHub stars. The repository holds 62 skills in this directory. The repository was last updated on September 14, 2026.

Source: phuryn/pm-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.