sql-tutor

Convert natural language requirements into SQL queries for SQLite and PostgreSQL.

12|2|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/haomingz/kimi-skills --skill sql-tutor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-tutor
Source: https://github.com/haomingz/kimi-skills/tree/main/skills/sql-tutor
Command: npx skills add https://github.com/haomingz/kimi-skills --skill sql-tutor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires psycopg2-binary, and includes scripts (resource) components.

What problem does it solve?

This Skill translates natural language requirements into SQL queries using embedded schema context to generate accurate, executable statements.

Core Features & Use Cases

  • NL→SQL translation: convert plain language prompts into executable SQL tailored to SQLite or PostgreSQL.
  • Query optimization: analyze SQL for common anti-patterns and suggest performance improvements.
  • Explain plan interpretation: parse and summarize EXPLAIN results to highlight bottlenecks and index usage.
  • Use Case: For a data analyst, convert a business question into a SQL query and get optimization and explain plan in one step.

Quick Start

Ask it to translate a natural language requirement into SQL and to optimize the query and explain its execution plan.

Frequently Asked Questions about sql-tutor

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

FAQPage Schema
How do I convert natural language to SQL for PostgreSQL or SQLite?

Natural language to SQL translation converts plain language requirements into executable SQL statements tailored to your schema context, supporting both SQLite and PostgreSQL databases for accurate query generation.

How do I optimize SQL queries and identify common anti-patterns?

SQL query optimization analyzes your statements for common anti-patterns and suggests performance improvements, helping you rewrite inefficient queries into faster, more executable database operations.

How do I interpret an EXPLAIN plan to find query bottlenecks?

EXPLAIN plan interpretation parses and summarizes execution results to highlight performance bottlenecks and index usage, explaining the implications of your SQL query execution path.

Do I need psycopg2 to connect to a live PostgreSQL database for query translation?

Yes, connecting to a live PostgreSQL database requires the psycopg2 driver and Python 3.9 or higher to execute the generated SQL queries and analyze their execution plans.

Can I translate business questions into SQL and get optimization guidance in one step?

Yes, you can translate a business question into an executable SQL query and receive both query optimization suggestions and an explain plan analysis simultaneously in a single request.

Why does my generated SQL query fail to execute on the live database?

Generated SQL query execution failures may stem from schema context mismatches or missing the psycopg2 driver for PostgreSQL connections, requiring Python 3.9 or higher to resolve environment dependencies.