Agent skill

SQL Queries

by killvxk in killvxk/pm-skills-zh

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

MITAuto-check passedDatabases

Install SQL Queries

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

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

GitHub CLI
$ gh skill install killvxk/pm-skills-zh 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/killvxk/pm-skills-zh.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
167
Token cost
~423 tokens
SKILL.md length
85 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 5 steps: 提供背景信息:分享你的数据库结构或表结构 → 描述清晰:明确说明你需要的数据及过滤条件 → 注明数据库类型:指定你使用的 SQL 方言 → …
  • Tasks that involve SQL
  • SKILL.md covers 用途, 工作原理, 使用示例 and 核心能力, 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 killvxk/pm-skills-zh. 将自然语言描述转化为 SQL 查询语句。支持 BigQuery、PostgreSQL、MySQL 及其他方言。可从上传的结构图或文档中读取数据库结构。适用于编写 SQL、构建数据报表、探查数据库,或将业务问题转化为查询语句。

Its SKILL.md is about 420 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 and Data warehousing. It works with SQL, Google BigQuery, MySQL and PostgreSQL. The repository describes itself as: PM Skills Marketplace 简体中文版 - 65个产品经理技能和36个工作流,翻译自 https://github.com/phuryn/pm-skills/. The licence is MIT.

When your agent uses it

  • Tasks that involve SQL
  • Tasks that involve Data warehousing

Example prompts

  • “/sql-queries”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 提供背景信息:分享你的数据库结构或表结构
  2. 描述清晰:明确说明你需要的数据及过滤条件
  3. 注明数据库类型:指定你使用的 SQL 方言
  4. 说明限制条件:提及数据量、时间范围和性能要求
  5. 明确输出格式:如需特定格式的查询结果,请提前说明

What it can do on your machine

Read from SKILL.md and the folder at commit 5179784. 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 423 tokens when it runs. Until then it costs about 31 tokens; SKILL.md has 85 words of instructions outside code blocks.

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

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 killvxk/pm-skills-zh at commit 5179784, republished under its MIT licence (© killvxk). 85 words, ~423 tokens.

Download SKILL.mdSave it as .claude/skills/sql-queries/SKILL.md (or your agent's skills folder).
name
sql-queries
description
将自然语言描述转化为 SQL 查询语句。支持 BigQuery、PostgreSQL、MySQL 及其他方言。可从上传的结构图或文档中读取数据库结构。适用于编写 SQL、构建数据报表、探查数据库,或将业务问题转化为查询语句。

SQL 查询生成器

用途

将自然语言需求转化为经过优化的 SQL 查询,支持多种数据库平台。帮助产品经理、分析师和工程师准确生成查询语句,无需手动处理语法细节。

工作原理

第一步:理解数据库结构
  • 如果你提供了结构文件(SQL、文档或结构图描述),我将读取并分析
  • 提取表名、字段定义、数据类型及关联关系
  • 识别主键、外键和索引策略
第二步:处理查询需求
  • 明确你需要检索或分析的具体数据
  • 确认 SQL 方言(BigQuery、PostgreSQL、MySQL、Snowflake 等)
  • 询问额外要求(过滤条件、聚合方式、排序规则)
第三步:生成优化查询
  • 编写充分利用数据库结构的高效 SQL
  • 添加注释,解释复杂逻辑
  • 针对大数据集提供性能优化建议
  • 如有适用,提供替代实现方案
第四步:解释与测试
  • 用通俗语言解释查询逻辑
  • 建议如何测试或验证结果
  • 提供性能优化技巧
  • 如有需要,生成测试脚本或示例数据

使用示例

示例一:基于结构文件生成查询

上传你的 database_schema.sql 文件,并输入:
"生成一个查询,找出过去 30 天内注册且至少有 5 次活跃会话的用户"

示例二:基于结构描述生成查询

"我的数据库结构如下:Users 表(id, email, created_at),Sessions 表
(id, user_id, timestamp, duration)。生成一个查询,
统计 2026 年 1 月每位用户的平均会话时长。"

示例三:复杂分析查询

"创建一个 BigQuery 查询,按地区和客户等级分析营收,
包含同比增长率。"

核心能力

  • 多方言支持:兼容 BigQuery、PostgreSQL、MySQL、Snowflake、SQL Server
  • 文件读取:读取结构文件、SQL dump 及数据文档
  • 查询优化:建议索引、分区及性能改进方案
  • 解释说明:拆解查询逻辑,便于学习和文档化
  • 测试支持:可生成测试查询和示例数据脚本
  • 脚本执行:为你的数据库创建可执行的 SQL 脚本

最佳实践建议

  1. 提供背景信息:分享你的数据库结构或表结构
  2. 描述清晰:明确说明你需要的数据及过滤条件
  3. 注明数据库类型:指定你使用的 SQL 方言
  4. 说明限制条件:提及数据量、时间范围和性能要求
  5. 明确输出格式:如需特定格式的查询结果,请提前说明

输出格式

你将收到:

  • SQL 查询:带注释的生产可用 SQL 代码
  • 说明:查询的功能和运行逻辑
  • 性能备注:优化建议和注意事项
  • 测试脚本(如有需要):示例数据和验证查询

延伸阅读

© killvxk, 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 killvxk/pm-skills-zh.

Open the folder on GitHubat commit 5179784

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 skillkillvxk/pm-skills-zh167—~423Automated safety check: PassMIT
SQL Queriesphuryn/pm-skills27k—~907Automated 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
Semantic Analystsidequery/sidemantic129—~982Automated safety check: PassAGPL-3.0
SQL Queriesw95/awesome-claude-corporate-skills2353 repos~2.8kAutomated safety check: PassMIT

Similar skills

  • SQL Queries

    phuryn/pm-skills

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

    27k GitHub stars~907 tokensUpdated 23 days 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
  • Semantic Analyst

    sidequery/sidemantic

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

    129 GitHub stars~982 tokensUpdated yesterday
    DatabasesAuto-check passed
  • SQL Queries

    w95/awesome-claude-corporate-skills

    Write correct, performant SQL across all major data warehouse dialects (Snowflake, BigQuery, Databricks, PostgreSQL, etc.).

    235 GitHub starsUsed in 3 repos~2.8k tokens
    DatabasesAuto-check passed
  • SQL Sentinel

    sickn33/agentic-awesome-skills

    Audit SQL for the cost & performance anti-patterns that burn warehouse credits.

    47k GitHub starsUsed in 1 repo~1.5k tokens
    DatabasesAuto-check passed

More from killvxk/pm-skills-zh

All 11 skills in this repo
  • Ab Test Analysis

    killvxk/pm-skills-zh

    分析 A/B 测试结果,涵盖统计显著性检验、样本量验证、置信区间计算及上线/延长/停止的决策建议。适用于评估实验结果、判断测试是否达到显著性、解读分流测试数据,或决定是否上线某个实验组。

    167 GitHub stars~480 tokensUpdated 6 mo ago
    Auto-check passed
  • Brainstorm Okrs

    killvxk/pm-skills-zh

    集思广益制定团队级 OKR(目标与关键成果),对齐公司目标——定性目标与可量化关键成果。适用于制定季度 OKR、将团队目标与公司战略对齐、起草目标,或学习如何编写有效的 OKR。

    167 GitHub stars~533 tokensUpdated 6 mo ago
    Auto-check passed
  • Cohort Analysis

    killvxk/pm-skills-zh

    对用户参与度数据执行同期群分析——留存曲线、功能采用趋势及分层洞察。适用于按同期群分析用户留存、研究功能随时间的采用情况、调查流失规律,或识别参与度趋势。

    167 GitHub stars~562 tokensUpdated 6 mo ago
    Auto-check passed
  • Dummy Dataset

    killvxk/pm-skills-zh

    生成用于测试的逼真虚拟数据集,支持自定义列、约束条件及输出格式(CSV、JSON、SQL、Python 脚本)。适用于创建测试数据、构建模拟数据集,或为开发和演示生成示例数据。

    167 GitHub stars~595 tokensUpdated 6 mo ago
    Auto-check passed
  • Interview Script

    killvxk/pm-skills-zh

    创建结构化的用户访谈脚本,包含 JTBD(用户待办任务)探测问题、破冰环节、核心探索及收尾部分。遵循"老妈测试"原则——不引导、不推销,聚焦过去的实际行为。适用于准备用户访谈、创建访谈指南或规划探索性研究时使用。

    167 GitHub stars~547 tokensUpdated 6 mo ago
    Auto-check passed
  • Metrics Dashboard

    killvxk/pm-skills-zh

    定义并设计产品指标看板,包含核心指标、数据来源、可视化类型和告警阈值。适用于创建指标看板、定义 KPI(关键绩效指标)、搭建产品分析体系或制定数据监控计划时使用。

    167 GitHub stars~741 tokensUpdated 6 mo ago
    Auto-check passed

Categories

Questions about SQL Queries

What does SQL Queries do?

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

When should I use SQL Queries?

SQL Queries fits situations like: tasks that involve SQL; tasks that involve Data warehousing.

How do I install SQL Queries in Claude Code?

Run `npx skills add killvxk/pm-skills-zh --skill sql-queries -a claude-code`. Or copy the skill folder (pm-data-analytics/skills/sql-queries in killvxk/pm-skills-zh) 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 killvxk/pm-skills-zh --skill sql-queries -a codex`. Or copy the skill folder (pm-data-analytics/skills/sql-queries in killvxk/pm-skills-zh) 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 killvxk/pm-skills-zh --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 423 tokens (SKILL.md is roughly 1.7k 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 (phuryn/pm-skills, 27k stars), SQL Query Explainer (mohitagw15856/pm-claude-skills, 1.4k stars), Chdb SQL (vemetric/vemetric, 394 stars) and Semantic Analyst (sidequery/sidemantic, 129 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains SQL Queries?

killvxk (a GitHub user) maintains it in killvxk/pm-skills-zh, which has 167 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on March 16, 2026.

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