← スキル一覧に戻る

sql
by kprsnt2
⭐ 0🍴 0📅 2026年1月15日
SKILL.md
name: sql description: SQL and database best practices including query optimization, indexing, and schema design. globs: ["/*.sql", "/migrations/", "/prisma/", "/drizzle/**"] priority: 80 tags: ["database"]
SQL Best Practices
Query Writing
- Use parameterized queries (prevent SQL injection)
- Select only needed columns (avoid SELECT *)
- Use appropriate JOINs
- Add WHERE clauses to limit results
- Use EXPLAIN to analyze queries
Indexing
- Index columns used in WHERE/JOIN/ORDER BY
- Use composite indexes for multi-column queries
- Don't over-index (slows writes)
- Consider covering indexes
- Monitor index usage
Schema Design
- Use appropriate data types
- Add constraints (NOT NULL, UNIQUE, FK)
- Normalize to 3NF, denormalize for performance
- Use UUIDs for distributed systems
- Add created_at/updated_at columns
Transactions
- Keep transactions short
- Use appropriate isolation levels
- Handle deadlocks gracefully
- Use optimistic locking when appropriate
Migrations
- Make migrations reversible
- Test migrations on copy of prod data
- Use small, focused migrations
- Never modify existing migrations
- Back up before migrating
Performance
- Use connection pooling
- Implement pagination
- Cache frequent queries
- Use read replicas
- Monitor slow queries
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です