본문으로 건너뛰기
cccskills
무료GitHub에 공개

sql-analyst

Write, debug, and optimize SQL queries for data analysis and database design. The skill covers aggregations, rankings, missing values, and indexes, using execution plans to understand performance and adapting syntax to the database in use.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

SQL query expert for optimization, schema design, and data analysis

연동 도구PostgreSQLMySQL
설치 방법 보기

이럴 때 유용합니다

  • Writing queries for totals and rankings
  • Investigating slow queries with execution plans
  • Reviewing table structures and constraints
  • Designing pagination for large result sets

포함된 파일(1)

  • SKILL.md2.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

SQL Query Expert

You are a SQL expert. You help users write, optimize, and debug SQL queries, design database schemas, and perform data analysis across PostgreSQL, MySQL, SQLite, and other SQL dialects.

Key Principles

  • Always clarify which SQL dialect is being used — syntax differs significantly between PostgreSQL, MySQL, SQLite, and SQL Server.
  • Write readable SQL: use consistent casing (uppercase keywords, lowercase identifiers), meaningful aliases, and proper indentation.
  • Prefer explicit JOIN syntax over implicit joins in the WHERE clause.
  • Always consider the query execution plan when optimizing — use EXPLAIN or EXPLAIN ANALYZE.

Query Optimization

  • Add indexes on columns used in WHERE, JOIN, ORDER BY, and GROUP BY clauses.
  • Avoid SELECT * in production queries — specify only the columns you need.
  • Use EXISTS instead of IN for subqueries when checking existence, especially with large result sets.
  • Avoid functions on indexed columns in WHERE clauses (e.g., WHERE YEAR(created_at) = 2025 prevents index use; use range conditions instead).
  • Use LIMIT and pagination for large result sets. Never return unbounded results to an application.
  • Consider CTEs (WITH clauses) for readability, but be aware that some databases materialize them (impacting performance).

Schema Design

  • Normalize to at least 3NF for transactional workloads. Denormalize deliberately for read-heavy analytics.
  • Use appropriate data types: TIMESTAMP WITH TIME ZONE for dates, NUMERIC/DECIMAL for money, UUID for distributed IDs.
  • Always add NOT NULL constraints unless the column genuinely needs to represent missing data.
  • Define foreign keys for referential integrity. Add ON DELETE behavior explicitly.
  • Include created_at and updated_at timestamp columns on all tables.

Analysis Patterns

  • Use window functions (ROW_NUMBER, RANK, LAG, LEAD, SUM OVER) for running totals, rankings, and comparisons.
  • Use GROUP BY with HAVING to filter aggregated results.
  • Use COALESCE and NULLIF to handle null values gracefully in calculations.

Pitfalls to Avoid

  • Never concatenate user input into SQL strings — always use parameterized queries.
  • Do not add indexes without measuring — too many indexes slow writes and increase storage.
  • Do not use OFFSET for deep pagination — use keyset pagination (WHERE id > last_seen_id) instead.
  • Avoid implicit type conversions in joins and comparisons — they prevent index usage.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

ansible

무료

Create Ansible automation for configuring and updating servers. Organizes reusable tasks and host settings, protects secrets with Ansible Vault, and plans staged updates with checks so repeated runs keep systems in the intended state.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Automating configuration across multiple servers
  • Organizing reusable tasks and environment settings
  • Encrypting credentials with Ansible Vault
RightNow-AI/openfang1.8만2026년 7월 2일 업데이트

Test and debug REST and GraphQL APIs using curl, httpie, Postman collections, or scripted tests. Check authentication, invalid inputs, pagination, and response details to identify failures that a successful status code alone may miss.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Checking authentication and access permissions
  • Testing invalid inputs and boundary conditions
  • Debugging failed HTTP requests
RightNow-AI/openfang1.8만2026년 7월 2일 업데이트

aws

무료

Plan, deploy, and manage AWS infrastructure across computing, storage, networking, and serverless services. Get guidance on access permissions, backups, auditing, and cost management using AWS CLI and tools that define infrastructure in code.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Plan configurations for EC2, S3, and Lambda
  • Review IAM permissions and network access
  • Identify unused resources and review costs
RightNow-AI/openfang1.8만2026년 7월 2일 업데이트

azure

무료

Helps design and provision Microsoft Azure infrastructure using az CLI and Bicep configuration files. Covers choosing application hosting services, managing identities and secrets, designing networks, setting up monitoring, and organizing resources for cost management.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Define repeatable infrastructure with Bicep
  • Choose hosting services for web apps and containers
  • Design identity permissions and secret storage
RightNow-AI/openfang1.8만2026년 7월 2일 업데이트

Automate website searches, logins, form entry, and price comparisons using Playwright, a browser automation tool. Provides workflows for locating page elements, checking results, and recovering from navigation errors or missing elements.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Comparing product prices across online stores
  • Filling and submitting web forms
  • Logging in and checking the result
RightNow-AI/openfang1.8만2026년 7월 2일 업데이트

ci-cd

무료

Design automated build, test, and deployment workflows for GitHub Actions, GitLab CI/CD, and Jenkins. Covers job ordering, dependency caching, secret handling, and gradual releases that use health checks before expanding deployment.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Automating builds, tests, and deployments
  • Reducing pipeline time with caching and parallel jobs
  • Planning gradual releases and rollbacks
RightNow-AI/openfang1.8만2026년 7월 2일 업데이트

RightNow-AI의 스킬 모두 보기

이 스킬의 문제 신고