跳到正文
cccskills
免费在 GitHub 公开

sql-queries

Turn everyday questions into SQL queries, the commands used to retrieve and summarize database records. Uses your database structure and platform to produce queries with explanations, performance notes, and optional validation scripts.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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.

查看安装方法

适用场景

  • Extract users who meet specific activity conditions
  • Build revenue reports by region and customer tier
  • Create queries from database diagrams
  • Understand query logic and validate results

包含的文件(1)

  • SKILL.md3.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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."

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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Analyze A/B test results to decide whether to launch a change, extend testing, stop, or investigate further. Check sample size, statistical significance, uncertainty ranges, and effects on other important metrics, then summarize the recommendation and next steps.

中文简介正在准备中。当前显示英语简介。

  • Checking whether an A/B test shows a meaningful difference
  • Reviewing sample size and test duration
  • Deciding whether to launch a tested change
phuryn/pm-skills2.7万2026年10月16日 更新

Organize customer feature requests into themes and rank the top three against product goals, customer value, effort, and risk. For each recommendation, explain the underlying need, possible alternatives, uncertain assumptions, and simple ways to test them.

中文简介正在准备中。当前显示英语简介。

  • Grouping customer requests into themes
  • Selecting the top three requests for product goals
  • Considering alternatives to requested features
phuryn/pm-skills2.7万2026年10月16日 更新

Compare growth options across existing and new products and markets using the Ansoff Matrix, a four-part planning framework. Assess opportunities, resources, competition, and risks, then develop market launch plans and a phased roadmap for priority options.

中文简介正在准备中。当前显示英语简介。

  • Comparing growth options for an existing business
  • Planning expansion into new regions or customer groups
  • Evaluating new products for current customers
phuryn/pm-skills2.7万2026年10月16日 更新

Choose the first customer segment for a product launch by comparing urgent needs, willingness to pay, achievable market share, and referral potential. Get scored recommendations, a priority segment, a 90-day acquisition plan, and expansion options.

中文简介正在准备中。当前显示英语简介。

  • Choosing the first customer segment for a new product
  • Focusing limited resources on a launch market
  • Comparing segments using interviews and customer feedback
phuryn/pm-skills2.7万2026年10月16日 更新

Plan low-effort experiments to check assumptions about an existing product before building a feature. Compare prototypes, A/B tests, and other methods, with a clear assumption, procedure, metric, and success threshold for each experiment.

中文简介正在准备中。当前显示英语简介。

  • Checking feature assumptions before implementation
  • Planning prototype usability tests
  • Defining metrics and success thresholds for A/B tests
phuryn/pm-skills2.7万2026年10月16日 更新

Turn a new product idea into a testable hypothesis and two or three simple experiments. Define target customers, expected actions, measurement methods, and success thresholds to assess demand through behavior such as sign-ups, pre-orders, or paid commitments.

中文简介正在准备中。当前显示英语简介。

  • Testing demand before building a new product
  • Planning landing page or waitlist experiments
  • Checking willingness to pay through pre-orders
phuryn/pm-skills2.7万2026年10月16日 更新

查看 phuryn 的全部技能

报告此技能的问题