Skip to main content

sql-best-practices

Use this skill when writing SQL queries — selects, joins, aggregations, window functions, or schema modifications. Apply whenever SQL is needed to ensure correctness, safety, and performance.

来源信息

仓库
aiming-lab/MetaClaw
最近来源活动
2026年3月10日 18:04
检测到的 SKILL.md 语言
英语
星标
3,456
分支
450

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
sql-best-practices
description
Use this skill when writing SQL queries — selects, joins, aggregations, window functions, or schema modifications. Apply whenever SQL is needed to ensure correctness, safety, and performance.
category
data_analysis
# SQL Best Practices **Query quality:** - Use `SELECT col1, col2` — never `SELECT *` in production code. - Use CTEs (`WITH`) for readability instead of deeply nested subqueries. - Filter early: apply `WHERE` before `JOIN` when possible to reduce data scanned. - Use `EXPLAIN` / `EXPLAIN ANALYZE` to inspect query plans for slow queries. **Safety:** - Always use parameterized queries from application code — never string interpolation. - Wrap destructive operations (`DELETE`, `UPDATE`, `DROP`) in a transaction. - Test on a staging/dev environment before running on production. **Naming:** `snake_case` for tables/columns, descriptive names, consistent pluralization.
在 GitHub 查看