sql-analysis
하는 일
이 스킬은 비즈니스 질문을 검증된 SQL 쿼리와 작은 결과 표로 바꿉니다. 쿼리를 직접 쓰지 않고 데이터베이스에서 숫자를 얻고 싶은 분석가와 관리자를 위한 스킬입니다.
사용하는 경우
- ✓데이터베이스에서 얼마나 되는지, 추세가 어떤지, 상위 항목이 무엇인지 물을 때.
- ✓데이터를 이용해 두 그룹이나 두 기간을 비교하고 싶을 때.
- ✓결과를 만든 쿼리와 함께 결과 표가 필요할 때.
스킬 링크
https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-dataagent/src/main/resources/shared/agents/data-agent/skills/sql-analysis/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“지난해 매월 신규 고객이 지역별로 몇 명이었는지 알려 주세요. 쿼리와 표를 함께 보여 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 질문을 지표, 그룹화, 시간 범위, 필터로 다시 정리합니다. SQL 초안을 작성해 실행하고, 행 수와 결과가 타당한지 확인한 뒤, 쿼리와 함께 결과 표를 보고합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
SQL Analysis Skill
Repeatable SOP for turning a business question into a verifiable SQL answer.
Steps
Restate the question as a metric. In one sentence, write: "<metric> by <grouping> over <time window>, filtered by <filter>". If any of those four (metric / grouping / window / filter) is missing or ambiguous, ask one clarifying question and stop. Do not guess.
Locate the source. Decide where the data lives:
- Look in
knowledge/first for any schema notes, data-dictionary entries, or prior query examples uploaded by the user. - If the right table is not obvious, delegate to the
data-explorersub-agent with the metric definition as the prompt — its job is to identify the canonical source.
- Look in
Draft the query. Write the SQL in a fenced
sqlblock. Conventions:- Always include the time window in a
WHEREclause — never query the full history "just in case". - Always
SELECTan explicit column list — neverSELECT *in an answer. - Use CTEs (
WITH x AS (...)) over nested subqueries for anything beyond two levels of nesting. - Comment any non-obvious filter (
-- excludes internal test accounts).
- Always include the time window in a
Validate before reporting. Run the query and check:
- Row count is in the ballpark you expected (1 row, 10 rows, ~30 daily buckets, etc.). A surprising row count is almost always a bug — investigate.
- No
NULLs in the grouping column unless that is the intended cohort. - At least one numeric sanity check: a known total, a known reference value, or a min/max range that matches reality.
- If anything looks off, do not report the number — fix the query first.
Write the report. Use this exact structure:
## Answer <one-sentence direct answer with the headline number(s)> ## Result <small markdown table — at most ~15 rows; for longer results, summarise and offer to render a chart or attach the full CSV> ## Query ```sql <the exact query you ran>Sources & validation
- Table(s):
schema.table_name(row count, freshness if known) - Validation: <which sanity checks you ran and the result>
- Caveats: <known data quality issues, missing dates, etc.>
- Table(s):
Anti-patterns
- ❌ Reporting a number without the query that produced it.
- ❌ Using
LIMIT Nto "make the output fit" without explaining what got cut. - ❌ Reading a single row and reporting it as a trend.
- ❌ Inventing a table or column name. If unsure, delegate to
data-explorer.
When to delegate
- The user's question requires probing several candidate tables / sources
before any query can be written → spawn
data-explorer. - The user wants a polished written deliverable summarising several analyses
(e.g. "weekly health report") → spawn
report-writerafter you have the underlying numbers ready.
자주 묻는 질문
빠진 세부 사항을 추측하나요?
아니요, 지표, 그룹화, 시간 범위, 필터가 불분명하면 스킬이 명확한 질문 하나를 합니다.
쿼리를 보여 주나요?
네, SQL과 결과 표를 함께 보여 줍니다.
답을 검증하나요?
네, 보고하기 전에 행 수와 값이 타당한지 확인합니다.
상세 정보
작성자의 원본 설명
Answer a quantitative business question by writing a SQL query against the data warehouse, validating it, and presenting the result. Use when the user asks "how many...", "what's the trend of...", "compare X vs Y over...", "what's our top N...", or anything that resolves to a query against tabular data. Produces a small result table plus the underlying query.
인기도
- GitHub 스타
- 6.2k
- 순위
- #14391
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agentscope-java
6.2k에이전트가 Project Reactor 위에 만들어진 다중 에이전트 프레임워크 AgentScope용 논블로킹 Java 코드를 작성하도록 돕습니다.
data-report
6.2k에이전트가 데이터셋을 평균, 합계, 범위, 추세가 담긴 보고서로 요약하고, Markdown 파일로 저장하도록 돕습니다.
data-transform
6.2k에이전트가 CSV, JSON 같은 형식 사이에서 데이터 파일을 변환해 다른 도구에서도 쓸 수 있게 돕습니다.
git-changelog
6.2k에이전트가 Git 기록에서 변경 로그나 출시 노트를 작성하도록 돕습니다. 기능, 수정, 기타 변경으로 묶어 정리합니다.
비슷한 스킬
discrawl
394k에이전트가 저장된 로컬 Discord 메시지 보관본을 검색하고 요약하며, 최신 상태를 확인하고 다이렉트 메시지를 읽도록 돕습니다.
clickhouse-io
280k에이전트가 ClickHouse 데이터베이스의 쿼리와 스키마를 최적화하도록 돕습니다. 고성능 분석 작업의 모범 사례를 적용합니다. 분석 쿼리가 느릴 때 씁니다.
scientific-db-pubmed-database
280k생의학 분야의 과학 논문을 에이전트가 검색하도록 돕습니다. 특정 의학 정보가 필요한 연구에 유용합니다.