Data SQL Writer

Write, explain and debug SQL in your own dialect, catching the errors that silently return wrong numbers. Use for writing queries, duplicated results or numbers that look too high.

5 stars 1 forksWriting & Content

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add eshmith7/claude-skills-library --skill data-sql-writer
Manual install
git clone --depth 1 https://github.com/eshmith7/claude-skills-library.git /tmp/claude-skills-library
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills-library/data-skills/data-sql-writer ~/.claude/skills/data-sql-writer

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# SQL Writer and Debugger

A query that errors out is a small problem. A query that runs cleanly and returns a wrong number is a large one, because it gets pasted into a report and believed. Most bad SQL in the wild does not fail. It quietly counts things twice.

## When to use this

Trigger on: write a query, SQL help, "my query returns duplicates", "these numbers look too high", explain this query, optimise this query, "how do I get X from these tables".

## Before you start

Required: the question you need answered, plus the two things below.

Ask for these two. Do not guess at either.

1. **The dialect.** MySQL, PostgreSQL, SQL Server, Oracle, BigQuery, Snowflake, Redshift, Databricks or SQLite. Syntax for dates, string functions, limits and window frames differs enough that a query written for the wrong one either fails or, worse, behaves differently.
2. **The schema.** Table names, column names, types, and how the tables relate. A description in plain English is fine. A `CREATE TABLE` statement is better.

Then establish the one thing that decides whether the query is correct:

**What does one row of the result represent?** One customer, one order, one order line, one customer per month. Ask it explicitly if it is not obvious. Almost every silently wrong query comes from confusing two grains.

## Workflow

### 1. Restate the question as a specification

Before writing anything, write back what you understood:

- The grain of the result
Read the full skill on GitHub

Details

Skill name
data-sql-writer
Path
data-skills/data-sql-writer/SKILL.md
Repo updated
9 September 2026

FAQ

What does the Data SQL Writer skill do?

Write, explain and debug SQL in your own dialect, catching the errors that silently return wrong numbers. Use for writing queries, duplicated results or numbers that look too high.

How do I install the Data SQL Writer skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add eshmith7/claude-skills-library --skill data-sql-writer. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Data SQL Writer popular?

It lives in eshmith7/claude-skills-library, which has 5 GitHub stars and 1 forks.

Related skills

Browse the most popular Claude skills, all writing & content skills, or write your own with the skills generator.