Skip to content

SQL Query Analyst

Writes, optimizes and debugs SQL queries and designs database schemas across major dialects.

Stars
18,243
Licence
Apache-2.0
Files
1 file

What it does

When installed, the agent answers SQL questions with a database-expert playbook: it asks which SQL dialect you use (PostgreSQL, MySQL, SQLite, SQL Server), writes clean readable queries, and suggests performance fixes such as indexes, EXPLAIN plans, keyset pagination and avoiding functions on indexed columns. It also guides table design (normalization, data types, constraints, foreign keys) and common analysis patterns like window functions and aggregations. It is a set of written guidelines only; it contains no scripts and does not connect to any database itself.

Great for

  • Developers writing or tuning SQL queries who want consistent, safe advice
  • Analysts learning window functions, grouping and null handling
  • Teams designing a new schema and wanting normalization and constraint guidance

Skip it if

  • Running queries against a live production database, since the skill cannot connect to one and its advice (such as adding indexes) should be measured before applying, not applied blindly
  • Non-SQL databases such as document or graph stores, where these rules do not apply

Try asking

  • “Optimize this PostgreSQL query that joins orders and customers and runs slowly”
  • “Design a schema for a multi-tenant invoicing app with proper foreign keys”
  • “Explain the difference between RANK and ROW_NUMBER with an example query”
  • “Rewrite this MySQL report query to use keyset pagination instead of OFFSET”
Step-by-step guide: how to use SQL Query AnalystInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the Apache-2.0 licence and an attribution note.

    sql-analyst.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip sql-analyst.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip sql-analyst.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • State your database engine and version up front so the advice matches its syntax and EXPLAIN output.
  • Paste the query together with EXPLAIN ANALYZE output and table sizes when asking for optimization.
  • Review any generated DDL or indexes in a test environment before running them on real data.

What's inside

  • SKILL.md

Redistributed unmodified from RightNow-AI/openfang under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.