sql-database-assistant

Convert user requirements into dialect-aware SQL with schema introspection and migration templates.

2|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/mdnaimul22/human-skills --skill sql-database-assistant-mdnaimul22
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-database-assistant
Source: https://github.com/mdnaimul22/human-skills/tree/main/skills/sql-database-assistant
Command: npx skills add https://github.com/mdnaimul22/human-skills --skill sql-database-assistant-mdnaimul22

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill solves the problem of turning database requirements into correct, performant SQL while keeping schemas and migrations safe and reversible.

Core Features & Use Cases

  • Natural Language to SQL & Query Patterns: Produce accurate queries using JOIN, CTEs, window functions, JSON operations, pagination, and UPSERT patterns across common database dialects.
  • Schema Exploration: Generate introspection queries to document tables, columns, keys, indexes, and schema-level details for PostgreSQL, MySQL, SQLite, and SQL Server.
  • Query Optimization & Migration Generation: Recommend performance improvements using EXPLAIN analysis signals and generate migration templates (up/down) with zero-downtime-friendly sequencing and rollback plans, plus ORM integration guidance for Prisma, Drizzle, TypeORM, and SQLAlchemy.
  • Use Case Example: You need to implement a feature that lists each department’s top 3 highest-paid employees with pagination and then add the minimal indexes and migrations to keep it fast; use this Skill to draft the query, validate the strategy with an optimization checklist, and generate migration templates for the schema changes.

Quick Start

Run the SQL database assistant to generate a dialect-aware query, propose indexes, and draft migration up/down steps for an example change request like “show top 3 salaries per department and add the right index on (department_id, salary)”.

Frequently Asked Questions about sql-database-assistant

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

FAQPage Schema
How do I write complex SQL queries using natural language requirements?

Natural language to SQL conversion translates your feature requirements into accurate queries using JOINs, CTEs, window functions, and UPSERT patterns. It generates dialect-aware SQL for PostgreSQL, MySQL, SQLite, and SQL Server.

How do I optimize slow PostgreSQL queries using EXPLAIN ANALYZE?

Query optimization analyzes EXPLAIN output to recommend performance improvements like minimal indexes. It validates your strategy using an optimization checklist to ensure complex queries like pagination or window functions remain performant.

What is the best way to generate reversible database migration templates?

Migration generation creates up and down scripts with zero-downtime-friendly sequencing and rollback plans. It produces reversible templates that safely apply schema changes while maintaining database integrity during deployments.

Does this SQL assistant support ORM integration with Prisma and TypeORM?

ORM integration guidance supports Prisma, Drizzle, TypeORM, and SQLAlchemy. It helps translate raw query patterns and schema introspection results into compatible ORM structures for your existing application stack.

How do I perform schema introspection to document database tables and indexes?

Schema introspection generates query templates to document tables, columns, keys, indexes, and schema-level details. It produces introspection queries compatible with PostgreSQL, MySQL, SQLite, and SQL Server for comprehensive database documentation.

Can I use EXPLAIN analysis for multi-dialect SQL query tuning?

EXPLAIN analysis applies across PostgreSQL, MySQL, SQLite, and SQL Server dialects. It evaluates query execution signals to recommend targeted performance improvements and necessary indexes for your specific database environment.