sql-queries
하는 일
필요한 데이터를 설명하면 SQL 쿼리를 작성하며, 스키마를 제공하면 그 스키마에 맞춥니다. SQL을 직접 쓰지 않고 데이터를 얻어야 하는 제품 관리자, 분석가, 엔지니어를 위한 스킬입니다.
사용하는 경우
- ✓데이터에 대한 쉬운 말의 질문을 SQL 쿼리로 바꿔야 할 때.
- ✓스키마 파일이 있고 그 테이블에 맞는 쿼리가 필요할 때.
- ✓쿼리에 대한 설명과 테스트 팁을 얻고 싶을 때.
스킬 링크
https://github.com/phuryn/pm-skills/blob/main/pm-data-analytics/skills/sql-queries/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 스키마 파일을 사용해서, 지난 분기에 가입했고 구매를 한 번 이상 한 사용자 목록을 보여 주는 쿼리를 작성해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 제공된 스키마를 읽고 데이터베이스 방언과 필터를 확인한 뒤, 주석을 달아 효율적인 쿼리를 작성합니다. 그다음 논리를 설명하고 결과를 확인하는 방법을 제안합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
SQL Query Generator
Purpose
Transform natural language requirements into optimized SQL queries across multiple database platforms. This skill helps product managers, analysts, and engineers generate accurate queries without manual syntax work.
How It Works
Step 1: Understand Your Database Schema
- If you provide a schema file (SQL, documentation, or diagram description), I will read and analyze it
- Extract table names, column definitions, data types, and relationships
- Identify primary keys, foreign keys, and indexing strategies
Step 2: Process Your Request
- Clarify the exact data you need to retrieve or analyze
- Confirm the SQL dialect (BigQuery, PostgreSQL, MySQL, Snowflake, etc.)
- Ask for any additional requirements (filters, aggregations, sorting)
Step 3: Generate Optimized Query
- Write efficient SQL that leverages your database structure
- Include comments explaining complex logic
- Add performance considerations for large datasets
- Provide alternative approaches if applicable
Step 4: Explain and Test
- Explain the query logic in plain English
- Suggest how to test or validate results
- Offer tips for performance optimization
- If you want, generate a test script or sample data
Usage Examples
Example 1: Query from Schema File
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"
Example 2: Query from Diagram Description
"Here's my database: 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."
Example 3: Complex Analysis Query
"Create a BigQuery query to analyze our revenue by region and customer tier,
including year-over-year growth rates."
Key Capabilities
- Multi-Dialect Support: Works with BigQuery, PostgreSQL, MySQL, Snowflake, SQL Server
- File Reading: Reads schema files, SQL dumps, and data documentation
- Query Optimization: Suggests indexes, partitioning, and performance improvements
- Explanation: Breaks down queries for learning and documentation
- Testing: Can generate test queries and sample data scripts
- Script Execution: Create executable SQL scripts for your database
Tips for Best Results
- Provide context: Share your database schema or structure
- Be specific: Clearly describe what data you need and any filters
- Mention database: Specify which SQL dialect you're using
- Include constraints: Mention data volume, time ranges, and performance needs
- Request format: Ask for the query result format if you need specific output
Output Format
You'll receive:
- SQL Query: Production-ready SQL code with comments
- Explanation: What the query does and how it works
- Performance Notes: Optimization tips and considerations
- Test Script (if requested): Sample data and validation queries
Further Reading
자주 묻는 질문
어떤 데이터베이스를 지원하나요?
BigQuery, PostgreSQL, MySQL, Snowflake와 그 밖의 방언을 지원합니다.
스키마가 필요한가요?
스키마 파일이나 설명이 있으면 테이블과 열 이름을 정확히 맞추는 데 도움이 됩니다.
쿼리를 대신 실행해 주나요?
쿼리를 작성하고 설명하며 테스트 방법을 제안하므로, 실행은 사용자의 환경에서 직접 합니다.
상세 정보
작성자의 원본 설명
Generate SQL queries from natural language descriptions. Supports BigQuery, PostgreSQL, MySQL, and other dialects. Reads database schemas from uploaded diagrams or documentation. Use when writing SQL, building data reports, exploring databases, or translating business questions into queries.
repo: phuryn/pm-skills
인기도
- GitHub 스타
- 28k
- 순위
- #9878
- 라이선스
- MIT
- 업데이트
- 2026. 10. 29.
댓글
- …
이 저장소의 다른 스킬
ab-test-analysis
28k에이전트가 A/B 테스트 결과를 읽고, 통계적 유의성과 표본 크기를 확인하며, 변형을 출시, 연장, 중단 중 무엇으로 할지 추천하도록 돕습니다.
cohort-analysis
28k에이전트가 코호트별로 사용자 잔존율을 분석하도록 돕습니다. 사용자 그룹마다 참여도와 기능 채택이 시간에 따라 어떻게 바뀌는지 보여 줍니다.
brainstorm-okrs
28k에이전트가 팀 OKR을 초안으로 작성하도록 돕습니다. 정성적인 목표와 측정 가능한 핵심 결과를 회사 목표에 맞춰 제시합니다.
create-prd
28k에이전트가 문제, 사용자, 가치, 첫 출시를 다루는 짧고 명확한 제품 요구 사항 문서를 작성하도록 돕습니다.
비슷한 스킬
discrawl
394k에이전트가 저장된 로컬 Discord 메시지 보관본을 검색하고 요약하며, 최신 상태를 확인하고 다이렉트 메시지를 읽도록 돕습니다.
clickhouse-io
280k에이전트가 ClickHouse 데이터베이스의 쿼리와 스키마를 최적화하도록 돕습니다. 고성능 분석 작업의 모범 사례를 적용합니다. 분석 쿼리가 느릴 때 씁니다.
scientific-db-pubmed-database
280k생의학 분야의 과학 논문을 에이전트가 검색하도록 돕습니다. 특정 의학 정보가 필요한 연구에 유용합니다.