agentsclimarketplace

Sql queries

Skill bg-szy/TOP-SKILLS/skills/marketplace/sql-queries

全球最大的 Claude Code 技能聚合库 · 收录 3900+ 来自 12+ 来源的技能,提供在线搜索与趋势分析看板 / The world's largest Claude Code skill aggregation hub — 3900+ skills from 12+ sources with online search and trend dashboard

Install
npx -y skills add bg-szy/TOP-SKILLS --skill sql-queries

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

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

SKILL.md

2.3 KB, 517 tokens by cl100k_base, as published. Nobody here has run it

SQL Query Expert — DBX Studio

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

Supported Dialects

DialectProvider
PostgreSQLDefault / Railway
SnowflakeVia MCP connector
BigQueryVia MCP connector
DatabricksVia MCP connector
MySQLVia connection string
SQLiteVia 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:

ToolWhen to Use
read_schemaFirst call — understand table structure
get_table_dataPreview rows before writing complex queries
execute_queryRun SELECT queries (SELECT/WITH only)
describe_tableGet column details, FK relationships
get_table_statsRow counts, distributions
generate_chartVisualize 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"

What ships with it: 1 file

22.0 KB alongside SKILL.md

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.