writing-queries

Develop SQL queries through phased design, coding, verification, and documentation.

3|1|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/tilmon-engineering/claude-skills --skill writing-queries
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-queries
Source: https://github.com/tilmon-engineering/claude-skills/tree/main/plugins/datapeeker/skills/writing-queries
Command: npx skills add https://github.com/tilmon-engineering/claude-skills --skill writing-queries

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides structured SQL query development to ensure correctness, documentation, and reproducibility in data analysis sessions.

Core Features & Use Cases

  • Phase-driven query design: Clarifies the analytical question, selects tables, and plans calculations before writing code.
  • Clean SQL with best practices: Comments, explicit aliases, proper NULL handling, and safe aggregations.
  • Documentation & reproducibility: Generates traceable query notes and results for auditability.
  • Use Case: When you need repeatable SQL analyses for dashboards, audits, or data science experiments.

Quick Start

Draft Phase 1 requirements and then generate a complete SQL query for a simple KPI, e.g., total revenue by region for last month.

Frequently Asked Questions about writing-queries

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

FAQPage Schema
How do I write SQL queries for reproducible data analysis?

To write SQL queries for reproducible data analysis, you must enforce a phased workflow that clarifies the analytical question, designs calculations, and verifies results before coding. This ensures queries are auditable and traceable.

What is the best way to document SQL queries for analytics?

The best way to document SQL queries for analytics is by generating traceable query notes and results alongside the code. This involves using explicit aliases, proper NULL handling, and thorough in-file comments to ensure auditability.

How do I structure a phased workflow for SQL query development?

Structuring a phased workflow for SQL query development involves moving sequentially from question clarification to table selection, calculation planning, coding, verification, and documentation for analytics tasks.

Does this SQL query development approach work across different relational data sources?

Yes, this SQL query development approach works across relational data sources by enforcing phase-based workflows, explicit joins, proper NULL handling, and safe aggregations to generate reproducible and auditable queries.

How do I handle NULL values in SQL data analysis queries?

To handle NULL values in SQL data analysis queries, you must apply proper NULL handling and safe aggregations during the coding phase. This ensures calculations remain correct and reproducible across relational data sources.