Showing 28 verified skills. 284 preview entries are hidden until we confirm a real source. Show preview skills · Why?
Generate complex SQL queries from natural language descriptions
claude install community/sql-query-builderNatural language to SQL: generate complex queries with proper joins, CTEs, window functions, and explain execution plans for optimization.
This is the actual SKILL.md file that powers this skill. Copy it to install.
---
name: sql-query-builder
description: |
Generate SQL queries from natural language. Trigger when the user needs SQL
queries, database analysis, or data extraction. Phrases: "write a SQL query",
"query the database", "how do I join", "SQL for", "CTE".
allowed-tools:
- Bash(psql *)
- Bash(mysql *)
- Bash(sqlite3 *)
- Read
- Write
---
# SQL Query Builder
Generate correct, performant SQL from natural language descriptions.
Supports PostgreSQL, MySQL, and SQLite with dialect-specific syntax.
## Workflow
1. **Understand** the schema (read migrations or describe tables)
2. **Clarify** ambiguous requirements before writing queries
3. **Write** the query with proper formatting
4. **Explain** what the query does and why it is structured that way
5. **Optimize** with indexes, query plans, and performance notes
## SQL style rules
- Uppercase SQL keywords (SELECT, FROM, WHERE, JOIN)
- Lowercase table and column names
- One clause per line for readability
- Always alias tables in JOINs
- Use CTEs over subqueries for readability
- Add comments for complex logic
## Example output
```sql
-- Monthly revenue by product category for the last 12 months
WITH monthly_revenue AS (
SELECT
p.category,
DATE_TRUNC('month', o.created_at) AS month,
SUM(oi.quantity * oi.unit_price) AS revenue
FROM orders o
JOIN order_items oi ON oi.order_id = o.id
JOIN products p ON p.id = oi.product_id
WHERE o.created_at >= NOW() - INTERVAL '12 months'
GROUP BY p.category, DATE_TRUNC('month', o.created_at)
)
SELECT * FROM monthly_revenue
ORDER BY category, month;
```
## Requirements
- Knowledge of the database schema (provide CREATE TABLE statements or ERD)
mkdir -p ~/.claude/skills/sql-query-builder~/.claude/skills/sql-query-builder/SKILL.mdResulting file structure:
~/.claude/
skills/
sql-query-builder/
SKILL.md <-- skill definitionSkills are loaded automatically by Claude Code when you start a new session. The skill name and description in the frontmatter determine when Claude triggers it.
Recommended from shared domain, career, and tool overlap with SQL Query Builder
Generate data dictionaries with business context from database schemas
Both used by Data Scientist, Software Engineer
Profile any dataset in seconds with distributions and quality metrics
Both used by Data Scientist, Software Engineer
Build RAG pipelines with embedding, retrieval, and cited generation
Both used by Data Scientist, Software Engineer
Build and test regex patterns with visual debugging
Both used by Data Scientist, Software Engineer
Generate realistic test data with proper relational structure
Both used by Data Scientist, Software Engineer
Design and optimize prompts with evaluation frameworks and A/B testing
Both used by Data Scientist, Software Engineer
SQL Query Builder