query-validation

nimrodfisher's avatarfrom nimrodfisher

SQL query review and validation for correctness, performance, and best practices. Use when reviewing queries for logical errors, optimizing query performance, checking for SQL anti-patterns, or validating business logic implementation in SQL.

0stars🔀0forks📁View on GitHub🕐Updated Jan 11, 2026

When & Why to Use This Skill

The Query Validation skill is a comprehensive SQL auditing tool designed to ensure database queries are accurate, efficient, and aligned with industry best practices. It helps developers and data analysts identify logical errors, optimize execution performance, and detect common SQL anti-patterns across various database systems like PostgreSQL, Snowflake, and BigQuery. By validating business logic against provided schemas, it minimizes the risk of production bugs and reduces unnecessary computational costs.

Use Cases

  • Performance Optimization: Identifying bottlenecks in slow-running queries and suggesting indexing or restructuring strategies to improve execution speed.
  • Logical Error Detection: Reviewing complex JOIN operations and WHERE clauses to ensure the query correctly implements the intended business logic.
  • Database Migration & Compatibility: Validating that SQL syntax and functions are compatible when moving queries between different database engines (e.g., from MySQL to Snowflake).
  • Code Quality Assurance: Automatically checking SQL scripts for anti-patterns and best practices during the peer review process to maintain high standards in data engineering pipelines.
namequery-validation
descriptionSQL query review and validation for correctness, performance, and best practices. Use when reviewing queries for logical errors, optimizing query performance, checking for SQL anti-patterns, or validating business logic implementation in SQL.

Query Validation

Quick Start

Review SQL queries for correctness, performance, and adherence to best practices.

Context Requirements

  1. SQL Query: The query to validate
  2. Database Type: PostgreSQL, MySQL, Snowflake, BigQuery, Redshift, etc.
  3. Schema Information: Relevant table structures
  4. Business Logic (optional): What the query should calculate
  5. Performance Context (optional): Expected row counts, current runtime

Context Gathering

For query input:

"Please provide:

  1. The SQL query to validate
  2. What database system you're using (PostgreSQL, Snowflake, etc.)
  3. Relevant table schemas (or I can help you extract them)"

For schema:

"To validate joins and column references, I need table schemas. You can provide:

Option 1 - Quick: Just the tables/columns used in the query

Option 2 - Comprehensive:

query-validation – AI Agent Skills | Claude Skills