CClaude Code Catalog
All Skills

SQL Query Builder

DataIntermediate

Understands the database table structure, then converts natural language questions into accurate SQL queries. Handles complex JOINs, subqueries, and window functions automatically.

Trigger/sql
Frequency3-5x/week

PM or planner who needs to pull data directly? Ask in plain English and /sql generates the query -- no dev team request needed

Junior data analyst? Write complex window functions and subqueries in natural language

SQLDatabaseQueryNo-Code

How It Works

Run /sql [natural language question]
Phase 1: 2 analyses in parallel
schema-read
Map table structure
intent-parse
Interpret query intent
Generate SQL query + explain execution plan
Executable SQL + sample results

Skill Code

# SQL Query Builder Skill ## Trigger: /sql [natural language question] When invoked: 1. Understand the database context: - Read schema files (if available) - Check for ORM models (Prisma, SQLAlchemy, etc.) - Ask for table structure if not found 2. Parse the natural language question: - Identify target tables - Determine filters, grouping, sorting - Detect aggregation needs 3. Generate SQL query: - Use proper JOINs when multiple tables - Add appropriate WHERE clauses - Include GROUP BY / HAVING if needed - Use window functions for rankings, running totals 4. Output format: --- ## 🗃️ SQL Query **Question**: [original question] ```sql SELECT ... FROM ... WHERE ... ``` **Explanation**: - [what each part does] **Expected Result**: | col1 | col2 | col3 | |------|------|------| | [sample] | [sample] | [sample] | **Performance Note**: [index suggestions if relevant] ---

Copy and paste into your CLAUDE.md to start using immediately.

How SQL Query Builder Works

SQL Builder takes a natural language question about your data, infers the database schema from context or provided table definitions, and generates an optimized SQL query with proper JOINs, aggregations, and WHERE clauses.

When to Use SQL Query Builder

Empowers non-SQL users to query databases directly and helps experienced developers write complex queries faster — especially useful for ad-hoc analysis where writing multi-table JOINs manually is error-prone.

Key Strengths

  • Translates natural language to optimized SQL instantly
  • Handles complex JOINs, subqueries, and aggregations
  • Infers schema relationships from table definitions
  • Accessible to non-technical team members

Same Category

Data View All

Popular in Other Categories