query-writing

Generate and execute SQL queries for data retrieval and analysis.

50|4|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/Hmbown/rlmagents --skill query-writing-hmbown
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-writing
Source: https://github.com/Hmbown/rlmagents/tree/main/examples/text-to-sql-agent/skills/query-writing
Command: npx skills add https://github.com/Hmbown/rlmagents --skill query-writing-hmbown

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables users to interact with databases by writing and executing SQL queries, making data retrieval and analysis accessible without direct database management expertise.

Core Features & Use Cases

  • SQL Query Generation: Assists in writing SQL queries, from simple single-table lookups to complex multi-table JOINs and aggregations.
  • Schema Awareness: Can retrieve and display database schemas to inform query writing.
  • Query Execution: Executes generated SQL queries against a database and returns the results.
  • Use Case: A marketing analyst needs to find the top 5 countries by revenue. They can use this skill to generate and run a SQL query that joins customer and invoice tables, aggregates revenue by country, and limits the output.

Quick Start

Use the query-writing skill to write and execute a SQL query that selects the top 5 countries by total revenue.

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 database analysis without direct database expertise?

This Skill generates and executes SQL queries against a database for data retrieval and analysis, abstracting direct database interaction so you do not need database management expertise to retrieve complex data.

Can I use SQL to join multiple tables and aggregate data for a specific report?

Yes, SQL supports complex multi-table JOINs and aggregations. You can generate queries that join customer and invoice tables, aggregate revenue by country, and limit output to find top countries by total revenue.

How do I retrieve and display a database schema to inform my query writing?

Schema awareness retrieves and displays database schemas to inform query writing. By exploring the database structure first, you can generate accurate SQL queries tailored to your specific tables and columns.

What is the best way to generate a SQL query for aggregating revenue by country?

The best way to aggregate revenue by country is to generate a SQL query that joins customer and invoice tables, groups the results by country, calculates the total revenue, and limits the output to the top 5 entries.

Do I need to know direct database management to run data retrieval queries?

No, you do not need direct database management expertise to run data retrieval queries. This approach abstracts direct database interaction, making data retrieval and analysis accessible by generating and executing SQL queries for you.