将自然语言数据需求转成高质量 SQL,并按方言优化复杂查询性能。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "write-query" 技能: 1. 下载 https://raw.githubusercontent.com/anthropics/knowledge-work-plugins/main/data/skills/write-query/SKILL.md 2. 保存为 ~/.claude/skills/write-query/SKILL.md 3. 装好后重载技能,告诉我可以用了
请用 BigQuery SQL 编写查询:统计过去 90 天每个渠道的订单数、总收入和平均客单价,只包含已支付订单,按收入降序排序,并使用清晰的 CTE 结构。
一条结构清晰的 BigQuery SQL,包含时间过滤、分组聚合、排序及最佳实践写法。
下面这条 Snowflake SQL 查询运行很慢,请重写并说明优化点:涉及 3 张大表 join,按月汇总活跃用户,尽量减少扫描数据量,并考虑分区裁剪和过滤下推。
优化后的 Snowflake SQL,以及针对扫描量、过滤顺序、CTE 与聚合策略的说明。
把这段 Postgres SQL 改写成适用于 Snowflake 的版本,保留原有逻辑,并处理日期函数、字符串拼接和空值处理的方言差异。
一条可在 Snowflake 使用的等价 SQL,并标注关键方言差异与替换原因。
If you see unfamiliar placeholders or need to check which tools are connected, see CONNECTORS.md.
Write a SQL query from a natural language description, optimized for your specific SQL dialect and following best practices.
/write-query <description of what data you need>
Parse the user's description to identify:
If the user's SQL dialect is not already known, ask which they use:
Remember the dialect for future queries in the same session.
If a data warehouse MCP server is connected:
Follow these best practices:
Structure:
daily_signups, active_users, revenue_by_product)Performance:
SELECT * in production queries -- specify only needed columnsEXISTS over IN for subqueries with large result setsReadability:
a, b, c)Dialect-specific optimizations:
sql-queries skill for details)Provide:
If a data warehouse is connected, offer to run the query and analyze the results. If the user wants to run it themselves, the query is ready to copy-paste.
Simple aggregation:
/write-query Count of orders by status for the last 30 days
Complex analysis:
/write-query Cohort retention analysis -- group users by their signup month, then show what percentage are still active (had at least one event) at 1, 3, 6, and 12 months after signup
Performance-critical:
…
帮助开发者将 Zoom 会议能力嵌入网页应用,支持完整界面或组件化集成。
生成带权重的销售预测,输出情景拆解、承诺分层与缺口分析。
帮助你为月末结账准备合规会计分录、借贷方向及支持材料。
帮助分析薪酬水平、职级带宽与股权方案,识别竞争力、异常点和留才风险。
帮助团队跟踪候选人招聘进度,统计各阶段人数并更新招聘状态。
研究竞争对手并生成定位、话术、机会与威胁对比分析
帮助你编写、优化并转换多种数据仓库方言的高质量 SQL 查询。
用自然语言查询 SQL 数据库,自动理解结构并生成纠错 SQL 结果
将自然语言转为 SQL 并查询多种数据库,还可做文档问答与语义缓存。
用自然语言查询 SQL 数据库,并自动生成、调试与修正查询语句。
帮助用户跨项目连接 PostgreSQL,检查模式、执行查询并分析性能。
用自然语言查询和管理 Snowflake 数据库,完成 SQL、结构探索与监控。