Tooluck logoTooluck
SKILL.md

sql-queries

Agent skill fromphuryn/pm-skills

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.

How to install sql-queries

install sql-queries
# install the pm-skills pack with the skills CLI
npx skills add phuryn/pm-skills

# or add only this skill to Claude Code: copy the folder

pm-data-analytics/skills/sql-queries/

# into

~/.claude/skills/sql-queries/ (all projects)

.claude/skills/sql-queries/ (one project)

pm-data-analytics/skills/sql-queries/SKILL.md

MITFull file
1# SQL Query Generator
2
3## Purpose
4Transform 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.
5
6## How It Works
7
8### Step 1: Understand Your Database Schema
9- If you provide a schema file (SQL, documentation, or diagram description), I will read and analyze it
10- Extract table names, column definitions, data types, and relationships
11- Identify primary keys, foreign keys, and indexing strategies
12
13### Step 2: Process Your Request
14- Clarify the exact data you need to retrieve or analyze
15- Confirm the SQL dialect (BigQuery, PostgreSQL, MySQL, Snowflake, etc.)
16- Ask for any additional requirements (filters, aggregations, sorting)
17
18### Step 3: Generate Optimized Query
19- Write efficient SQL that leverages your database structure
20- Include comments explaining complex logic
21- Add performance considerations for large datasets
22- Provide alternative approaches if applicable
23
24### Step 4: Explain and Test
25- Explain the query logic in plain English
26- Suggest how to test or validate results
27- Offer tips for performance optimization
28- If you want, generate a test script or sample data
29
30## Usage Examples
31
32**Example 1: Query from Schema File**
33```
34Upload your database_schema.sql file and say:
35"Generate a query to find users who signed up in the last 30 days
36and had at least 5 active sessions"
37```
38
39**Example 2: Query from Diagram Description**
40…

Excerpt shown under the repository's MIT license.

More skills in pm-skills

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates