Skip to content
cccskills
FreePublished on 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.

OriginalShow the original 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.

See how to install

Good for

  • 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

Files included (1)

  • SKILL.md3.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

ab-test-analysis

FreeSummary

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-skills27.2KUpdated Oct 16, 2026

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-skills27.2KUpdated Oct 16, 2026

ansoff-matrix

FreeSummary

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-skills27.2KUpdated Oct 16, 2026

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-skills27.2KUpdated Oct 16, 2026

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-skills27.2KUpdated Oct 16, 2026

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-skills27.2KUpdated Oct 16, 2026

See all skills by phuryn

Report a problem with this skill