본문으로 건너뛰기
Skillpedia
데이터베이스28k · #9878

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/phuryn/pm-skills/blob/main/pm-data-analytics/skills/sql-queries/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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

  1. Provide context: Share your database schema or structure
  2. Be specific: Clearly describe what data you need and any filters
  3. Mention database: Specify which SQL dialect you're using
  4. Include constraints: Mention data volume, time ranges, and performance needs
  5. 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬