query-writing

Write and execute SQL queries to retrieve data and generate reports.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/ladinglogichq/lading-logic-hackathon --skill query-writing-ladinglogichq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-writing
Source: https://github.com/ladinglogichq/lading-logic-hackathon/tree/main/.agents/skills/query-writing
Command: npx skills add https://github.com/ladinglogichq/lading-logic-hackathon --skill query-writing-ladinglogichq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writes and executes SQL queries to retrieve data, generate reports, and validate results from relational databases without manual SQL drafting.

Core Features & Use Cases

  • Plan and compose SELECT queries across single or multiple tables, including joins, filters, aggregates, and subqueries.
  • Inspect schemas with sql_db_schema to identify columns and relationships before querying.
  • Execute queries using sql_db_query and return structured results with clear formatting for analysis.
  • Apply best practices such as limiting results, using aliases, and guarding against common syntax errors.

Quick Start

Ask me to write and execute an SQL query against your database and return the results.

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 to generate reports from a database?

To write SQL queries, you can plan and compose SELECT statements across single or multiple tables, execute them, and return structured results with clear formatting for data analysis and reporting.

What is the best way to inspect a database schema before writing complex SQL joins?

Inspecting a database schema involves identifying table columns and relationships before querying. You can derive the schema first to ensure your SQL joins, filters, and aggregations target the correct data structures.

Can I use SQL subqueries and aggregations across multiple tables?

Yes, you can compose SQL queries that include subqueries, aggregations, and joins across one or more tables to retrieve data and generate reports from relational databases.

How do I avoid common SQL syntax errors when drafting queries?

Avoid SQL syntax errors by applying best practices such as limiting results, using table aliases, and guarding against common mistakes while composing your SELECT statements and subqueries.