Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
phuryn avatar

Sql Queries

  • 1.9k installs
  • 24.9k repo stars
  • Updated July 3, 2026
  • phuryn/pm-skills

sql-queries generates dialect-aware SQL from natural language using uploaded schemas and business questions.

About

The sql-queries skill from phuryn pm-skills turns business questions into SQL for product managers, analysts, and engineers. Step 1 reads schema files, SQL dumps, or diagram descriptions to extract tables, columns, keys, and relationships. Step 2 clarifies required data, SQL dialect, filters, and aggregations. Step 3 writes efficient SQL with comments, performance notes, and alternatives for large datasets. Step 4 explains logic in plain English with validation and optimization tips. Supports BigQuery, PostgreSQL, MySQL, Snowflake, and SQL Server. Use when writing SQL, building data reports, exploring databases, or translating natural language analytics questions into queries.

  • Reads schema files and documentation before generating SQL.
  • Multi-dialect support: BigQuery, PostgreSQL, MySQL, Snowflake, SQL Server.
  • Clarifies filters, aggregations, and dialect before query generation.
  • Includes comments, performance tips, and plain-English explanations.
  • Optional test scripts or sample data suggestions for validation.

Sql Queries by the numbers

  • 1,936 all-time installs (skills.sh)
  • +81 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #54 of 911 Databases skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

sql-queries capabilities & compatibility

Capabilities
schema ingestion · dialect aware sql generation · query optimization notes · plain english explanations · multi platform dialect support
Works with
postgres · mysql · snowflake
Use cases
data analysis · database
From the docs

What sql-queries says it does

Transform natural language requirements into optimized SQL queries across multiple database platforms.
SKILL.md
npx skills add https://github.com/phuryn/pm-skills --skill sql-queries

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.9k
repo stars24.9k
Security audit3 / 3 scanners passed
Last updatedJuly 3, 2026
Repositoryphuryn/pm-skills

How do I turn a business question into correct SQL for my database?

Generate optimized SQL from natural language across BigQuery, PostgreSQL, MySQL, Snowflake, and other dialects using uploaded schemas.

Who is it for?

PMs and analysts who need SQL without hand-writing every dialect detail.

Skip if: Database schema design or ETL pipeline authoring without a concrete query ask.

When should I use this skill?

User asks to write SQL, generate query from schema, or translate analytics question to SQL.

What you get

An optimized, commented SQL query with explanation and validation tips.

  • Optimized SQL queries
  • Dialect-specific SELECT statements
  • Report-ready data queries

Files

SKILL.mdMarkdownGitHub ↗

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

Related skills

How it compares

Use sql-queries for natural-language-to-SQL with schema context, not for ORM code generation or migration authoring.

FAQ

Which SQL dialects are supported?

BigQuery, PostgreSQL, MySQL, Snowflake, SQL Server, and similar platforms.

Should I upload a schema first?

Yes when available; the skill extracts tables, keys, and relationships before writing SQL.

Does it explain the query?

Yes. Step 4 explains logic in plain English with optimization and validation tips.

Is Sql Queries safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Databasesdatabasesanalytics

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.