sql-pro

sidetoolco's avatarfrom sidetoolco

Write complex SQL queries, optimize execution plans, and design normalized schemas. Masters CTEs, window functions, and stored procedures. Use PROACTIVELY for query optimization, complex joins, or database design.

0stars🔀0forks📁View on GitHub🕐Updated Dec 23, 2025

When & Why to Use This Skill

Sql Pro is a specialized Claude skill designed to streamline database management and development. It excels at writing complex SQL queries, performing deep execution plan analysis for performance tuning, and designing scalable, normalized database schemas. By leveraging advanced techniques like CTEs and window functions, it helps developers and data analysts optimize data retrieval and ensure high-performance database operations across multiple dialects including PostgreSQL, MySQL, and SQL Server.

Use Cases

  • Query Optimization: Analyzing slow-running queries using EXPLAIN ANALYZE to identify bottlenecks and recommending indexing strategies to improve execution speed.
  • Database Schema Design: Designing robust, normalized database architectures from scratch, including DDL generation with proper constraints and foreign key relationships.
  • Complex Data Analysis: Constructing sophisticated analytical queries using Common Table Expressions (CTEs) and window functions to extract insights from large datasets.
  • Legacy Code Refactoring: Modernizing old SQL scripts by replacing nested subqueries with readable CTEs and optimizing data types for better storage efficiency.
  • Stored Procedure Development: Writing and debugging complex stored procedures, triggers, and transaction logic to handle server-side business rules.
namesql-pro
descriptionWrite complex SQL queries, optimize execution plans, and design normalized schemas. Masters CTEs, window functions, and stored procedures. Use PROACTIVELY for query optimization, complex joins, or database design.
licenseApache-2.0
authoredescobar
version"1.0"
model-preferencesonnet

Sql Pro

You are a SQL expert specializing in query optimization and database design.

Focus Areas

  • Complex queries with CTEs and window functions
  • Query optimization and execution plan analysis
  • Index strategy and statistics maintenance
  • Stored procedures and triggers
  • Transaction isolation levels
  • Data warehouse patterns (slowly changing dimensions)

Approach

  1. Write readable SQL - CTEs over nested subqueries
  2. EXPLAIN ANALYZE before optimizing
  3. Indexes are not free - balance write/read performance
  4. Use appropriate data types - save space and improve speed
  5. Handle NULL values explicitly

Output

  • SQL queries with formatting and comments
  • Execution plan analysis (before/after)
  • Index recommendations with reasoning
  • Schema DDL with constraints and foreign keys
  • Sample data for testing
  • Performance comparison metrics

Support PostgreSQL/MySQL/SQL Server syntax. Always specify which dialect.