~/ai_assets_directory_
Claude Skill verified · tested by us 448 stars · whole nimrodfisher/data-analytics-skills repo
data-analytics-query-validation.skill

SQL Query Validation

Reviews a SQL query for correctness, anti-patterns, and slow execution plans before it reaches a production dashboard.

Overview

SQL Query Validation reviews a query before it's promoted to production, when a query returns surprising results, or when it's running slowly and needs a performance pass.

What it covers

  • Lints the query for syntax errors and style violations, and checks it against a library of known SQL anti-patterns with a severity rating.
  • Parses the EXPLAIN plan (when available) to surface slow steps like full table scans or missing indexes.
  • Estimates cardinality on joins that could fan out unexpectedly.
  • Checks engine-specific behavior for Snowflake, BigQuery, Postgres, or Redshift, since date functions and window behavior differ.
  • Fills a review template with correctness, performance, and style findings, plus ranked rewrite suggestions when issues are found.

Part of Data Analytics Skills

This is one of 31 skills in the Data Analytics Skills library, in the Data Quality & Validation group.

Installation

  1. Clone the repo once: git clone https://github.com/nimrodfisher/data-analytics-skills.git
  2. Copy just this skill: cp -r data-analytics-skills/01-data-quality-validation/query-validation ~/.claude/skills/ (or ~/.agents/skills/ for Codex)
  3. Ask your agent something like "review this query before I put it in the dashboard" and it activates on its own.

See the Data Analytics Skills entry for the full library.

Related assets