Agent skill

sql-and-query-mastery

Stars 5
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/Gaku52/claude-code-skills/tree/main/06-data-and-security/sql-and-query-mastery

SKILL.md

日本語版

SQL and Query Mastery

SQL is the universal language of data manipulation. This skill systematically covers everything from basic syntax to advanced window functions, query optimization, execution plan analysis, and database-specific features.

Target Audience

  • Engineers who want to learn SQL systematically
  • Developers looking to optimize query performance
  • Those involved in database design and operations

Prerequisites

  • Foundational understanding of relational databases
  • Basic SQL knowledge (SELECT/INSERT/UPDATE/DELETE)

Study Guide

00-basics — SQL Fundamentals

# File Description

01-advanced — Advanced SQL

# File Description

02-optimization — Query Optimization

# File Description

03-specific — Database-Specific Features

# File Description

Quick Reference

SQL Performance Checklist:
  ✓ Verify execution plans with EXPLAIN ANALYZE
  ✓ Create appropriate indexes
  ✓ Avoid SELECT *; query only the columns you need
  ✓ Resolve N+1 queries with JOINs
  ✓ For large datasets, use cursor-based pagination instead of LIMIT/OFFSET
  ✓ Perform aggregations on the database side

References

  1. PostgreSQL. "Documentation." postgresql.org/docs, 2024.
  2. Winand, M. "SQL Performance Explained." use-the-index-luke.com, 2012.
  3. Molinaro, A. "SQL Cookbook." O'Reilly, 2020.

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results