sql-queries

Generate, optimize, and debug SQL queries across multiple database dialects.

82|10|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/Dbxstudio/dbx-studio --skill sql-queries-dbxstudio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-queries
Source: https://github.com/Dbxstudio/dbx-studio/tree/main/.claude/skills/sql-queries
Command: npx skills add https://github.com/Dbxstudio/dbx-studio --skill sql-queries-dbxstudio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill assists users in writing, optimizing, and debugging SQL queries for various database systems, ensuring dialect-appropriate and safe query generation.

Core Features & Use Cases

  • Intelligent Query Generation: Creates SQL queries based on natural language descriptions.
  • Dialect Support: Adapts to PostgreSQL, Snowflake, BigQuery, Databricks, MySQL, and SQLite.
  • Query Safety: Enforces rules like adding LIMIT clauses and quoting identifiers to prevent errors and security risks.
  • Tool Integration: Leverages specific tools like read_schema, get_table_data, and execute_query for accurate query development.
  • Use Case: A user needs to find the top 5 customers by revenue in the last quarter. The AI uses read_schema to understand the orders and customers tables, then execute_query with a safe SELECT statement including a LIMIT to retrieve the data.

Quick Start

Use the sql-queries skill to generate a safe SELECT query with a limit of 100 rows from the 'users' table.

Frequently Asked Questions about sql-queries

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

FAQPage Schema
How do I generate SQL queries from a natural language description?

To generate SQL queries from natural language, you describe the desired data retrieval in plain text. The tool translates your description into a dialect-appropriate SQL query, automatically quoting identifiers and adding LIMIT clauses to ensure safe execution.

Can I use this to write and optimize SQL for both Snowflake and PostgreSQL?

Yes, you can write and optimize SQL for both Snowflake and PostgreSQL. It supports multiple database dialects, adapting the generated queries to the specific syntax and functions required by systems like Snowflake, PostgreSQL, BigQuery, Databricks, MySQL, and SQLite.

How does this tool ensure query safety when executing database commands?

Query safety is enforced by automatically applying LIMIT clauses to prevent excessively large result sets and properly quoting identifiers to avoid syntax errors. It also integrates with schema reading and query execution tools to validate structure before running.

What is the best way to debug an SQL query that keeps failing?

The best way to debug a failing SQL query is to leverage the integrated schema reading tool. By analyzing the table structures and integrating query execution, the tool identifies structural mismatches, applies correct identifier quoting, and optimizes the query logic.

Do I need to provide my database schema to generate accurate SQL queries?

You need accurate database schema details to generate correct SQL queries. The tool integrates with a read_schema function to automatically retrieve table structures, ensuring the generated queries match your actual columns, relationships, and data types.

Why does my generated SQL query include a LIMIT clause I did not specify?

Your generated SQL query includes an automatic LIMIT clause as a built-in safety mechanism. This precaution prevents accidentally retrieving massive datasets during query execution, ensuring database stability and protecting against performance degradation.