Skip to main content

This skill may not reflect the latest upstream change

Next.js Releases update on 2026-11-09 may affect this skill Last checked Nov 25, 2026.

ProductAI reviewed Jul 21, 2026

sql-queries

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.

v1.0.0New

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install pm-skills-sql-queries
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/pm-skills-sql-queries/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

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

  • The Product Analytics Playbook: AARRR, HEART, Cohorts & Funnels for PMs
  • How to Become a Technology-Literate PM
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
draft-ndaDraft a detailed Non-Disclosure Agreement between two parties covering information types, jurisdiction, and clauses needing legal review. Use when creating confidentiality agreements or preparing an NDA for a partnership.7 installstest-scenariosCreate comprehensive test scenarios from user stories with test objectives, starting conditions, user roles, step-by-step actions, and expected outcomes. Use when writing QA test cases, creating test plans, defining acceptance tests, or preparing for feature validation.6 installsstartup-canvasGenerate a Startup Canvas combining Product Strategy (9 sections) and Business Model (costs + revenue) for a new product. An alternative to BMC and Lean Canvas that separates strategy from business model. Use when launching a new product or evaluating a startup concept.5 installscreate-prdCreate a lean, decision-ready Product Requirements Document with an 8-section template: summary, contacts, background, objective, market segments, value propositions (6-part JTBD template), solution, and release. Lean by default (about one to two pages), with a fuller spec on request. Use when writing a PRD, documenting product requirements, preparing a feature spec, or reviewing an existing PRD.5 installsideal-customer-profileIdentify the Ideal Customer Profile (ICP) from research data with demographics, behaviors, JTBD, and needs. Use when defining your ICP, analyzing PMF survey data, or understanding who your best customers are.4 installsmetrics-dashboardDefine and design a product metrics dashboard with key metrics, data sources, visualization types, and alert thresholds. Use when creating a metrics dashboard, defining KPIs, setting up product analytics, or building a data monitoring plan.4 installs

More from Product Management Skills

View source →
swot-analysisPerform a detailed SWOT analysis — strengths, weaknesses, opportunities, and threats with actionable recommendations. Use when doing strategic assessment, competitive analysis, or evaluating a product or business position.41 installsproduct-visionBrainstorm an inspiring, achievable, and emotional product vision that motivates teams and aligns stakeholders. Use when defining or refining a product vision, creating a vision statement, or aligning the team around a shared direction.16 installsvalue-propositionDesign a detailed value proposition using a 6-part JTBD template — Who, Why, What before, How, What after, Alternatives. Use when creating a value proposition, analyzing customer value delivery, or articulating why customers should choose your product.12 installsgrammar-checkIdentify grammar, logical, and flow errors in text and suggest targeted fixes without rewriting the entire text. Use when proofreading content, checking writing quality, or reviewing a draft.10 installsprivacy-policyDraft a detailed privacy policy covering data types, jurisdiction, GDPR and compliance considerations, and clauses needing legal review. Use when creating a privacy policy, updating data protection documentation, or preparing for compliance.10 installssummarize-meetingSummarize a meeting transcript into structured notes with date, participants, topic, key decisions, summary points, and action items. Use when processing meeting recordings, creating meeting notes, writing meeting minutes, or recapping discussions.8 installs

More Product skills

Browse category →
smcSmart Money Concepts (ICT) signal engine. Uses the smartmoneyconcepts library to implement institutional-trading-school analysis of BOS, ChoCH, FVG, and order blocks (OB).8 installselliott-waveElliott Wave Theory signal engine. Detects swing points through Zigzag, matches 5-wave impulse and 3-wave corrective structures, validates them with Fibonacci wave relationships, and generates trend-top / correction-complete signals. Pure in-house pandas implementation.6 installschanlun基于缠论(缠中说禅)的形态识别引擎,使用czsc库自动检测K线分型、笔、中枢,并生成一买/一卖/二买/二卖/三买/三卖等买卖点信号。支持多周期分析和形态分类(3/5/7/9/11笔形态)。4 installsproduct-strategyCreate a comprehensive product strategy using the 9-section Product Strategy Canvas — vision, segments, costs, value propositions, trade-offs, metrics, growth, capabilities, and defensibility. Use when building a product strategy, creating a strategic plan, or defining product direction.4 installspricing-strategyAnalyze and design pricing strategies including pricing models, competitive pricing analysis, willingness-to-pay estimation, and price elasticity. Use when setting prices, evaluating pricing models, preparing for a pricing change, or comparing freemium vs paid approaches.3 installsmonetization-strategyBrainstorm 3-5 monetization strategies with audience fit, risks, and validation experiments. Use when exploring revenue models, evaluating pricing strategies, or deciding how to monetize a product.3 installs

Frequently asked questions about sql-queries

What does the sql-queries skill do?

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. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the sql-queries skill?

Run `npx @skills-hub-ai/cli install pm-skills-sql-queries` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/pm-skills-sql-queries/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does sql-queries work with?

sql-queries runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the sql-queries skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use sql-queries after installing it?

In Claude Code, type `/pm-skills-sql-queries` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the sql-queries skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.