sql-query-helper

Generate, optimize, and explain SQL queries for PostgreSQL, MySQL, SQLite, and SQL Server.

1|1|Updated Nov 22, 2025
One-click install
npx skills add https://github.com/ntaksh42/agents --skill sql-query-helper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-query-helper
Source: https://github.com/ntaksh42/agents/tree/main/.claude/skills/sql-query-helper
Command: npx skills add https://github.com/ntaksh42/agents --skill sql-query-helper

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of writing, refining, and understanding SQL queries, ensuring efficiency and accuracy in database interactions.

Core Features & Use Cases

  • SQL Generation: Create SQL queries from natural language descriptions.
  • Query Optimization: Improve the performance of existing SQL queries by identifying and fixing inefficiencies like N+1 problems and suggesting index usage.
  • Query Explanation: Translate complex SQL queries into human-readable explanations, detailing execution flow and logic.
  • DDL Generation: Generate CREATE TABLE statements for various database systems.
  • Database Support: Works with PostgreSQL, MySQL, SQLite, and SQL Server.

Quick Start

Generate a SQL query to list users who made more than 3 orders in 2024, sorted by order count descending.

Frequently Asked Questions about sql-query-helper

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write SQL queries from natural language descriptions?

SQL generation converts plain English descriptions directly into executable database queries. You describe the desired data logic, and the system outputs the corresponding SQL statement for PostgreSQL, MySQL, SQLite, or SQL Server.

How can I optimize SQL queries to fix N+1 problems and improve performance?

Query optimization identifies inefficiencies like N+1 problems and resolves them by restructuring the SQL and suggesting appropriate index usage. This process improves execution speed and reduces database load across supported systems.

How do I understand complex SQL queries and their execution flow?

Query explanation translates intricate SQL statements into human-readable summaries detailing execution flow and logic. It also includes EXPLAIN plan analysis to break down how the database engine processes the query.

Can I generate DDL scripts like CREATE TABLE statements for different database systems?

Yes, DDL generation automates the creation of CREATE TABLE statements. It supports multiple database systems including PostgreSQL, MySQL, SQLite, and SQL Server, ensuring schema setup matches your specific environment.

Does this SQL helper work with both PostgreSQL and SQL Server?

Yes, the tool fully supports PostgreSQL and SQL Server alongside MySQL and SQLite. It handles query generation, optimization, and explanation tailored to the specific syntax and performance characteristics of each platform.

What is the best way to analyze an EXPLAIN plan for slow running queries?

Analyzing an EXPLAIN plan involves reviewing the execution steps to detect bottlenecks like full table scans or missing indexes. The system interprets the plan and recommends index optimizations to resolve performance issues.