sql-analysis
Skill1 starsChanged 48 days agoMITView on GitHub
Explore a database schema, write safe read-only SQL to answer business questions, and explain the results and the query. Use when the user asks a question about data that lives in a SQL database, wants a query written or debugged, or needs a metric defined in SQL.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- atsushi-green/ds-ai-coding-skillstheir own version, first seen Sep 25, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- atsushi-green/ds-ai-coding-skills★ 86same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- academic-researchSkill
- codebase-auditSkill
- code-documentationSkill
- code-reviewSkill
- competitive-analysisSkill
- data-analysisSkill
- email-assistantSkill
- fullstack-dev-teamSkill
- github-integrationSkill
- market-researchSkill
- pdf-analysisSkill
- research-paperSkill
- ui-ux-designSkill
- web-researchSkill
- web-searchSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Read-only by default: Only run SELECT / WITH / EXPLAIN.
- Distinctive: line 32
Define the metric in words: before writing SQL ("active user = at least one order in the last 30 days, excluding test accounts").
- Very specific: line 34
Protect the database: add LIMIT while exploring.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SQL Analysis
Overview
Answers questions from relational databases (PostgreSQL, MySQL, SQLite, BigQuery, Snowflake…) by learning the schema first and running only read-only queries, then explaining both the answer and the SQL.
When to Use
- "How many users signed up last week?", "top customers by revenue", "why is this query slow?"
- Writing or reviewing SQL, defining a metric precisely.
Usage
Read-only by default. Only run SELECT / WITH / EXPLAIN. Never run INSERT, UPDATE, DELETE, DROP, ALTER, TRUNCATE or GRANT unless the user explicitly asks and confirms the exact statement.
- Learn the schema: list tables and columns (
information_schema), primary/foreign keys, and row counts of the tables you'll touch. Look at a few sample rows. - Define the metric in words before writing SQL ("active user = at least one order in the last 30 days, excluding test accounts"). Confirm ambiguous definitions.
- Write the query with CTEs named for what they hold, explicit join conditions, and explicit time zones for date logic.
- Protect the database: add
LIMITwhile exploring; checkEXPLAINbefore running anything that scans large tables. - Sanity-check results: totals vs known numbers, no join fan-out (compare row counts before/after joins), NULL handling.
- Report: the answer, a small result table, the final SQL, and assumptions.
Examples
Prompt: "What's our 30-day retention for users who signed up in August?"
The agent finds users(created_at) and events(user_id, occurred_at), confirms that "retained" means any event on days 25–35, writes a cohort query with CTEs, and reports the rate with the SQL.
Limitations
- Needs a database connection or tool supplied by the user's environment.
- SQL dialects differ; the agent states which dialect it wrote for.
Changelog
- 1.0.0 — Initial release.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

