query-writing

Write and execute SQL queries against a database using schema discovery.

1|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/leesk212/dannys-coding-ai-agent-final --skill query-writing-leesk212
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-writing
Source: https://github.com/leesk212/dannys-coding-ai-agent-final/tree/main/ETC/deepagents_sourcecode/examples/text-to-sql-agent/skills/query-writing
Command: npx skills add https://github.com/leesk212/dannys-coding-ai-agent-final --skill query-writing-leesk212

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generating correct SQL and executing queries against a database can be error-prone and time-consuming; this Skill streamlines the process by guiding you from schema discovery to query execution and result formatting.

Core Features & Use Cases

  • Schema-aware query planning: identify tables and relations using the database schema.
  • Support for simple and complex queries: SELECTs, JOINs, aggregations, subqueries, and filters.
  • Execution and presentation: run queries and present results in a readable format for reports and dashboards.

Quick Start

Ask it to generate and run a simple SELECT query on the Customers table to return the top 5 records.

Frequently Asked Questions about query-writing

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

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

To write and execute SQL queries for data analysis, the Skill uses schema discovery to map columns accurately, then generates and runs statements like SELECTs, JOINs, and aggregations to retrieve and present readable results.

Can I use complex multi-table joins and aggregations in my database queries?

Yes, you can use complex multi-table joins and aggregations in database queries. The Skill supports JOINs, GROUP BY, ORDER BY, and filters, enabling multi-table data analyses for software-engineering and analytics tasks.

What is the best way to run SQL queries without accidentally modifying the database?

The best way to run SQL queries safely is to use a Skill that avoids dangerous statements entirely. It focuses on SELECT operations with WHERE and LIMIT clauses to retrieve data without risking modifications.

How do I discover the database schema before generating SQL statements?

You discover the database schema before generating SQL statements through the Skill's schema-aware query planning. It automatically identifies tables and relations to ensure accurate column mapping prior to execution.

Does this data-analysis tool support subqueries and filtering?

Yes, this data-analysis tool supports subqueries and filtering. It handles simple lookups and complex analyses by applying WHERE filters and aggregations to format results for reports and dashboards.