sql-pro

Writes and optimizes complex SQL queries across cloud databases and OLTP/OLAP systems.

Updated Jun 12, 2026
One-click install
npx skills add https://github.com/bilacchi/agents-skills --skill sql-pro-bilacchi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sql-pro
Source: https://github.com/bilacchi/agents-skills/tree/main/skills/sql-pro
Command: npx skills add https://github.com/bilacchi/agents-skills --skill sql-pro-bilacchi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing and tuning complex SQL for modern databases is error-prone and time-consuming, especially when dealing with query plans, indexing strategies, and hybrid OLTP/OLAP workloads across cloud platforms. ## Core Features & Use Cases - Query Writing & Optimization: Builds complex analytical queries with window functions, recursive CTEs, and advanced JOINs, then validates them with EXPLAIN plans. - Performance Tuning: Designs indexing strategies, partitioning schemes, and statistics management for large tables and time-series data. - Schema & Architecture Design: Covers dimensional modeling, data vault, multi-tenant SaaS schemas, and cloud-native platforms like Snowflake, BigQuery, Aurora, and PostgreSQL. - Use Case: Optimize a slow analytical query over a billion-row Snowflake table by inspecting the execution plan, adding appropriate indexes or clustering keys, and validating performance under realistic load. ## Quick Start Ask the assistant to optimize a slow SQL query by sharing the query text, table schema, and the output of EXPLAIN from your database.

Frequently Asked Questions about sql-pro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize a slow SQL query with indexes?▼

Start by inspecting the query execution plan with EXPLAIN to find full table scans or expensive joins. Then design indexes based on actual usage patterns, update table statistics, and validate the improvement under realistic data volumes.

How to write complex analytical SQL queries with window functions?▼

Define the query goal and expected output first, then use window functions, recursive CTEs, and advanced aggregations for tasks like cohort analysis or time-series reporting. Validate correctness against sample data before running at scale.

Does this approach work with Snowflake and BigQuery?▼

Yes, the guidance covers cloud data warehouses including Snowflake, Google BigQuery, Amazon Redshift, and Databricks, as well as cloud-native databases like Aurora and Azure SQL Database. Platform-specific extensions and features are considered during optimization.

When should I not use SQL query tuning guidance?▼

Avoid it when you only need ORM-level guidance, when the system is non-SQL or document-only, or when you cannot access query plans or schema details. Without execution plans and statistics, optimization recommendations cannot be validated.

Is it safe to test heavy queries on a production database?▼

No, avoid running heavy exploratory queries on production without safeguards. Use read replicas, query limits, or staging environments, and validate performance under controlled load before deploying changes.