Agent skill
sql-queries
Expert SQL query generation for DBX Studio. Use when writing, optimizing, or debugging SQL queries against user database connections.
Install this agent skill to your Project
npx add-skill https://github.com/aiskillstore/marketplace/tree/main/skills/dbxstudio/sql-queries
SKILL.md
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:
SELECT * FROM "schema"."table" LIMIT 100;
CTEs for complex queries
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
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
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_schemaordescribe_tablefirst
Response Format
- Execute tool to get data
- Answer the user's question directly with the result
- Show SQL in ```sql blocks only if the user asks "how" or "show me the query"
- Present numbers clearly: "There are 1,247 orders this month"
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
perigon-backend
Perigon ASP.NET Core + EF Core + Aspire conventions
perigon-agent
Pointers for Copilot/agents to apply Perigon conventions
perigon-angular
Angular 21+ standalone/Material/signal conventions for Perigon WebApp
fastapi-mastery
Comprehensive FastAPI development skill covering REST API creation, routing, request/response handling, validation, authentication, database integration, middleware, and deployment. Use when working with FastAPI projects, building APIs, implementing CRUD operations, setting up authentication/authorization, integrating databases (SQL/NoSQL), adding middleware, handling WebSockets, or deploying FastAPI applications. Triggered by requests involving .py files with FastAPI code, API endpoint creation, Pydantic models, or FastAPI-specific features.
context7-efficient
Token-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.
browser-use
Browser automation using Playwright MCP. Navigate websites, fill forms, click elements, take screenshots, and extract data. Use when tasks require web browsing, form submission, web scraping, UI testing, or any browser interaction.
Didn't find tool you were looking for?