query-writing

Write and run read-only SQL queries for relational data analysis.

30|7|Updated Nov 10, 2025
One-click install
npx skills add https://github.com/taishan1994/Agent-Handbook --skill query-writing-taishan1994
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-writing
Source: https://github.com/taishan1994/Agent-Handbook/tree/main/langchain_v1%2B/examples/codes/text2sql_agent/skills/query-writing
Command: npx skills add https://github.com/taishan1994/Agent-Handbook --skill query-writing-taishan1994

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing and executing SQL queries to extract actionable insights from relational data, including both simple single-table queries and complex multi-table joins.

Core Features & Use Cases

  • Query construction: Generate correct SELECT, JOIN, and aggregation patterns across tables from a known schema.
  • Safe, read-only execution: Emphasizes read-only operations and validates query structure before execution.
  • Use Case: Ideal for analytics dashboards, ad-hoc data exploration, and reporting tasks that require precise data retrieval.

Quick Start

Ask me to write a SQL query to answer your business question given the current database schema.

Frequently Asked Questions about query-writing

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

FAQPage Schema
How do I write SQL queries for multi-table JOIN analysis?

To write SQL queries for multi-table analysis, the Skill constructs correct SELECT and JOIN patterns using your relational database schema. It validates the query structure before execution to ensure safe, read-only data retrieval.

Can I run SQL queries that modify or delete data?

No, you cannot modify or delete data. The Skill enforces strict read-only operations and validates query structure before execution, ensuring safe, repeatable data retrieval without risking accidental updates to your relational database.

What is the best way to explore a database schema before writing a query?

The best way to explore a database schema is by using metadata helpers. The Skill supports schema exploration with metadata helpers to understand table structures, enabling accurate query construction for your business analytics and reporting tasks.

Does this SQL query writer work for both simple and complex data analysis?

Yes, the SQL query writer works for both simple and complex data analysis. It handles everything from single-table questions to complex multi-table JOIN analyses across business analytics and reporting scenarios, formatting results clearly for ad-hoc exploration.

How do I format SQL query results for reporting dashboards?

To format SQL query results for reporting dashboards, the Skill applies clear result formatting after retrieving data. It ensures precise data retrieval through validated read-only queries, making the output directly suitable for analytics dashboards and reporting tasks.