SQL Generation

IntermediadataContexto mínimo: 16K

Generates optimized SQL queries from natural language descriptions. Supports multiple dialects (PostgreSQL, MySQL, SQLite, SQL Server), handles complex joins, subqueries, window functions, and CTEs. Includes query explanation and performance optimization hints.

Casos de uso

  • Converting business questions to SQL queries
  • Optimizing slow queries with EXPLAIN analysis
  • Generating migration scripts
  • Building complex reporting queries
  • Database schema design from requirements

Prompt de ejemplo

Generate a PostgreSQL query for the following requirement:

"Find the top 10 customers by total order value in the last 30 days,
including their order count and average order value. Exclude customers
who have any cancelled orders."

Schema context:
- customers (id, name, email, created_at)
- orders (id, customer_id, total, status, created_at)

Requirements:
- Use CTEs for readability
- Include performance hints (indexes to consider)
- Explain the query logic step by step

Modelos recomendados

Herramientas compatibles

claude-codecursorgithub-copilotkiroany

Modalidades

Entrada: text
Salida: code, text

Skills relacionadas

Autor

OpenModels Community

@openmodelsrun
SQL Generation — AI Agent Skill | OpenModels