sql-queries-tool

Expert SQL query generation for DBX Studio. Use when writing, optimizing, or debugging SQL queries against user database connections.

25 stars

Best use case

sql-queries-tool is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Expert SQL query generation for DBX Studio. Use when writing, optimizing, or debugging SQL queries against user database connections.

Teams using sql-queries-tool should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/sql-queries-tool/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/aiskillstore/marketplace/dbxstudio/sql-queries-tool/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/sql-queries-tool/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How sql-queries-tool Compares

Feature / Agentsql-queries-toolStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Expert SQL query generation for DBX Studio. Use when writing, optimizing, or debugging SQL queries against user database connections.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# SQL Query Expert — DBX Studio

This project supports multiple database backends via user connections. Always write dialect-appropriate SQL.

## Supported Dialects

| Dialect | Provider |
|---------|----------|
| PostgreSQL | Default / Railway |
| Snowflake | Via MCP connector |
| BigQuery | Via MCP connector |
| Databricks | Via MCP connector |
| MySQL | Via connection string |
| SQLite | Via connection string |

## Query Patterns

### Safe SELECT with limit
Always add LIMIT unless the user explicitly wants all rows:
```sql
SELECT * FROM "schema"."table" LIMIT 100;
```

### CTEs for complex queries
```sql
WITH ranked AS (
  SELECT *, ROW_NUMBER() OVER (PARTITION BY category ORDER BY created_at DESC) AS rn
  FROM orders
)
SELECT * FROM ranked WHERE rn = 1;
```

### Aggregations
```sql
SELECT
  DATE_TRUNC('month', created_at) AS month,
  COUNT(*) AS total,
  SUM(amount) AS revenue
FROM orders
GROUP BY 1
ORDER BY 1 DESC;
```

### Window Functions
```sql
SELECT
  user_id,
  amount,
  SUM(amount) OVER (PARTITION BY user_id ORDER BY created_at) AS running_total
FROM transactions;
```

## Tool Usage in DBX Studio AI

The AI has access to these tools — always use them rather than guessing:

| Tool | When to Use |
|------|-------------|
| `read_schema` | First call — understand table structure |
| `get_table_data` | Preview rows before writing complex queries |
| `execute_query` | Run SELECT queries (SELECT/WITH only) |
| `describe_table` | Get column details, FK relationships |
| `get_table_stats` | Row counts, distributions |
| `generate_chart` | Visualize query results |

## Query Safety Rules
- Only SELECT and WITH (CTEs) are permitted via `execute_query`
- Always quote identifiers: `"schema"."table"."column"`
- Add LIMIT automatically unless the user asks for all data
- Validate table/column names exist via `read_schema` or `describe_table` first

## Response Format
1. Execute tool to get data
2. Answer the user's question directly with the result
3. Show SQL in ```sql blocks only if the user asks "how" or "show me the query"
4. Present numbers clearly: "There are **1,247 orders** this month"

Related Skills

optimizing-sql-queries

25
from ComeOnOliver/skillshub

Execute use when you need to work with query optimization. This skill provides query performance analysis with comprehensive guidance and automation. Trigger with phrases like "optimize queries", "analyze performance", or "improve query speed".

model-quantization-tool

25
from ComeOnOliver/skillshub

Model Quantization Tool - Auto-activating skill for ML Deployment. Triggers on: model quantization tool, model quantization tool Part of the ML Deployment skill category.

model-explainability-tool

25
from ComeOnOliver/skillshub

Model Explainability Tool - Auto-activating skill for ML Training. Triggers on: model explainability tool, model explainability tool Part of the ML Training skill category.

data-normalization-tool

25
from ComeOnOliver/skillshub

Data Normalization Tool - Auto-activating skill for ML Training. Triggers on: data normalization tool, data normalization tool Part of the ML Training skill category.

learning-a-tool

25
from ComeOnOliver/skillshub

Create learning paths for programming tools, and define what information should be researched to create learning guides. Use when user asks to learn, understand, or get started with any programming tool, library, or framework.

mermaid-tools

25
from ComeOnOliver/skillshub

Extracts Mermaid diagrams from markdown files and generates high-quality PNG images using bundled scripts. Activates when working with Mermaid diagrams, converting diagrams to PNG, extracting diagrams from markdown, or processing markdown files with embedded Mermaid code.

markdown-tools

25
from ComeOnOliver/skillshub

Converts documents to markdown with multi-tool orchestration for best quality. Supports Quick Mode (fast, single tool) and Heavy Mode (best quality, multi-tool merge). Use when converting PDF/DOCX/PPTX files to markdown, extracting images from documents, validating conversion quality, or needing LLM-optimized document output.

no-tools

25
from ComeOnOliver/skillshub

Instructions only skill

../../../marketing-skill/prompt-engineer-toolkit/SKILL.md

25
from ComeOnOliver/skillshub

No description provided.

doc-sync-tool

25
from ComeOnOliver/skillshub

自动同步项目中的 Agents.md、claude.md 和 gemini.md 文件,保持内容一致性。支持自动监听和手动触发。

security-scanning-tools

25
from ComeOnOliver/skillshub

This skill should be used when the user asks to "perform vulnerability scanning", "scan networks for open ports", "assess web application security", "scan wireless networks", "detect malware", "check cloud security", or "evaluate system compliance". It provides comprehensive guidance on security scanning tools and methodologies.

scanning-tools

25
from ComeOnOliver/skillshub

This skill should be used when the user asks to "perform vulnerability scanning", "scan networks for open ports", "assess web application security", "scan wireless networks", "detec...