Guide · Agent skill
How to use the SQL Query Generator agent skill (sql-queries)
Updated · written with AI from the project's own documentation and checked against our catalogue data
The SQL Query Generator is an agent skill called sql-queries that teaches an AI agent to write SQL from plain-English descriptions of the data you need. It is aimed at product managers, analysts, engineers and students who need queries but do not write SQL often. By the end of this guide you will know what the skill does, how to install it, how to ask for queries in a way that gets useful results, and where you still need to check the output yourself.
Quick start
- 1Get the skill. Download the sql-queries ZIP from our page and unzip it.
- 2Place it where your agent can load it. Unzip into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps, upload it under Settings → Capabilities → Skills.
- 3Prepare your schema. Gather a SQL file, documentation or a written list of your tables, columns and relationships.
- 4Make a natural request. Describe the business question, the database dialect and any filters or time ranges.
- 5Review the query and explanation. Check that the logic matches your question and that the column names come from your schema.
- 6Validate before relying on it. Run the query on a small range or test data and compare results with known figures.
What is an agent skill and what does this one do?
An agent skill is a folder containing a SKILL.md file with instructions that an AI agent loads when a task matches the skill's description. This skill is defined in SKILL.md and its description covers writing SQL, building data reports, exploring databases and translating business questions into queries.
Once installed, the agent can take a business question such as 'find users who signed up in the last 30 days' and write the SQL to answer it. It can read a schema you provide, such as a SQL file, documentation or a written description of tables, so the query uses your actual table and column names. It also explains what the query does and suggests how to check the results.
- Writes SQL for BigQuery, PostgreSQL, MySQL, Snowflake and SQL Server, plus other dialects it is asked for.
- Reads schema files, SQL dumps and data documentation, and extracts tables, columns, keys and relationships.
- Explains query logic in plain English and suggests ways to validate results.
- Can suggest indexes, partitioning and other performance improvements, and can generate test queries or sample data scripts if you ask.
What the skill does not do
The skill only shapes the agent's writing. It does not connect to your database or run queries itself. You need your own database and SQL client to run the generated queries. The skill also does not run scripts and does not use the network.
Treat the output as a draft. The SKILL.md file says the output is production-ready SQL with comments, but you should still review it for correctness and cost before running it against real data.
How do you install the sql-queries skill?
Download the ZIP for this skill from our page and unzip it. You can install it in one of two ways. For a personal install, unzip it into ~/.claude/skills/. To limit it to one project, unzip it into that project's .claude/skills/ folder.
If you use the Claude apps, you can instead upload the skill under Settings → Capabilities → Skills.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into .claude/skills/ inside your project
- Claude apps: Settings → Capabilities → Skills, then upload the skill
What do you need before you start?
You need an AI agent that loads SKILL.md skills. You also need a database and a SQL client of your choice to run the generated queries. Neither is included with this skill.
- An AI agent that loads SKILL.md skills
- A database and SQL client of your choice, not included
- Your table and column names, or a schema file, for best results
How do you trigger the skill with a natural request?
You do not need a special command. Describe the data you want in plain language and mention the database if you know it. The skill asks for the dialect, filters and sorting if you leave them out. The examples below are taken from the skill's own usage examples.
- Upload your database_schema.sql file and ask: Generate a query to find users who signed up in the last 30 days and had at least 5 active sessions.
- Describe your tables inline: Users table (id, email, created_at), Sessions table (id, user_id, timestamp, duration). Generate a query for average session duration per user in January 2026.
- Ask for a platform-specific report: Create a BigQuery query to analyze our revenue by region and customer tier, including year-over-year growth rates.
Upload your database_schema.sql file and say:
"Generate a query to find users who signed up in the last 30 days
and had at least 5 active sessions"What should you check in the output?
The skill returns the SQL query, a plain-English explanation, performance notes and, if requested, a test script. Read the explanation against your question to confirm the logic matches what you meant, such as the date range and the join conditions.
Run the query first on a small time range or a test database, compare a few results against figures you already know, and check the estimated cost before running large queries. This matters most for financial or compliance reporting, where the results should be validated against known numbers.
- Confirm the filters, date range and grouping match your question.
- Compare a few results with figures you already know.
- Check cost and data volume before running on large tables.
- Do not run generated queries unattended against live production databases.
Tips for better SQL from the skill
The skill's guidance is to share your schema, be specific about the data and filters, name the database dialect, and mention data volume and time ranges. Specifying the output format also helps.
- Provide context: share your schema or structure.
- Be specific about the data you need and any filters.
- Name the SQL dialect you use.
- Include constraints such as data volume, time ranges and performance needs.
- Ask for the result format you need.
What people use it for
- Product managers writing a query to find users who signed up in the last 30 days.
- Analysts building a revenue report by region and customer tier with year-over-year growth.
- Engineers getting a first draft of a query across BigQuery, PostgreSQL or MySQL.
- Students who want a SQL query explained step by step.
- Teams documenting what a query does for future reference.
Frequently asked questions
How do I install the sql-queries skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps, you can upload it under Settings → Capabilities → Skills.
Is the SQL Query Generator skill free?
The skill is listed under the MIT licence. This page does not list pricing, so check the source repository for any terms beyond the licence.
Which databases does it support?
The SKILL.md lists BigQuery, PostgreSQL, MySQL, Snowflake and SQL Server, and says it supports other dialects. It writes SQL text only and does not connect to any database.
Does the skill run my queries or connect to my database?
No. The skill only generates SQL text. It does not run scripts or use the network, so you need your own database and SQL client to run the queries.
Can it read my database schema?
Yes. You can provide a SQL file, documentation or a written description of tables, and the skill reads it to extract table names, columns, data types and relationships.
Should I trust the generated SQL without checking?
No. Review the logic, test on a small range or sample data, and validate results against known figures, especially for financial or compliance reporting.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you need a first draft of SQL from plain-English questions, especially if you can supply your schema and will review the output before running it. Pick something else if you need queries executed or connected to a live database automatically, or if you need guaranteed-exact results for financial or compliance reporting without a person checking them.
Download the skill