sql-query-writer

Generate dialect-aware SQL queries for PostgreSQL, MySQL, SQLite, and BigQuery.

5|4|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/Jignesh-Ponamwar/skills-mcp --skill sql-query-writer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-query-writer
Source: https://github.com/Jignesh-Ponamwar/skills-mcp/tree/main/skill_mcp/skills_data/sql-query-writer
Command: npx skills add https://github.com/Jignesh-Ponamwar/skills-mcp --skill sql-query-writer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sqlparse, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Helps developers write correct, readable, and performant SQL queries across multiple dialects (PostgreSQL, MySQL, SQLite, BigQuery), reducing trial-and-error and speeding up data work.

Core Features & Use Cases

  • Dialect-aware query construction with guidance for PostgreSQL, MySQL, SQLite, and BigQuery
  • Ready-to-use patterns and templates (CTEs, window functions, aggregations, subqueries) to accelerate query design
  • Performance-focused tips including EXPLAIN usage, indexing guidance, and common anti-pattern avoidance
  • Use cases spanning data analysis, reporting dashboards, data migrations, and ad-hoc querying with strong correctness guarantees

Quick Start

Describe your target table and goal, and ask it to generate an optimized, production-ready SQL query.

Frequently Asked Questions about sql-query-writer

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

FAQPage Schema
How do I write optimized SQL queries across multiple dialects like PostgreSQL and MySQL?

Optimized SQL queries require dialect-aware construction that generates correct syntax for PostgreSQL, MySQL, SQLite, and BigQuery while incorporating performant patterns like CTEs and window functions. This approach reduces trial-and-error during data work.

What is the best way to use CTEs and window functions for data analysis?

The best way to use CTEs and window functions is applying ready-to-use query patterns and templates that ensure readability and correctness for data analysis. These structured patterns accelerate query design for reporting and aggregations.

How do I use EXPLAIN and indexing guidance to improve query performance?

You use EXPLAIN and indexing guidance to improve query performance by analyzing execution plans and applying recommended indexes. This process helps avoid common anti-patterns and ensures your queries remain performant at scale.

Does this SQL query generation approach work with both SQLite and BigQuery?

Yes, this SQL query generation approach works with SQLite and BigQuery, alongside PostgreSQL and MySQL. It provides dialect-aware query construction to ensure correct syntax and optimization specific to each supported database platform.

Can I generate production-ready SQL for reporting dashboards and data migrations?

Yes, you can generate production-ready SQL for reporting dashboards and data migrations. Dialect-aware query construction provides strong correctness guarantees and optimized templates suitable for these specific data tasks.

What are common SQL anti-patterns to avoid when optimizing queries?

Common SQL anti-patterns to avoid when optimizing queries include inefficient aggregations and poorly structured subqueries. Performance-focused guidance helps identify these issues through EXPLAIN analysis and recommends proper indexing to resolve them.