Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add jiushiwon/wg-skills --skill database-learning-skillgit clone --depth 1 https://github.com/jiushiwon/wg-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/jiushiwon/wg-skills/database-learning-skill)<a href="https://agentmods.dev/skills/jiushiwon/wg-skills/database-learning-skill"><img src="https://agentmods.dev/badge/skills/jiushiwon/wg-skills/database-learning-skill/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/jiushiwon/wg-skills/database-learning-skill"><img src="https://agentmods.dev/badge/skills/jiushiwon/wg-skills/database-learning-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00101 | $0.01897 |
| Opus 5.5 | $0.00040 | $0.00759 |
| Sonnet 5.5 | $0.00020 | $0.00379 |
| Haiku 4.5 | $0.00010 | $0.00190 |
Grade A, and why
database-learning-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 221 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Learning Skill
面向零基础学习者,系统学习数据库核心概念,掌握数据库选型与优化能力。
核心理念
数据库 = 数据的仓库 + 管理的艺术
学数据库不是背命令,而是理解:
- 数据如何组织(表结构)
- 数据如何关联(关系)
- 数据如何高效查找(索引)
- 数据如何安全(事务)
- 什么场景选什么数据库(选型)
学习路径
数据库入门
↓
表结构设计(数据结构)
↓
数据查询(SQL 基础)
↓
索引与查询优化
↓
事务与并发控制
↓
MySQL vs PostgreSQL 选型
学习模块
1. 数据结构(表设计)
| 概念 | 说明 |
|---|---|
| 表(Table) | 数据的二维表格,像 Excel |
| 字段(Column) | 表的列,如 id、name、age |
| 记录(Row) | 表的行,一条数据 |
| 主键(Primary Key) | 唯一标识一条记录 |
| 外键(Foreign Key) | 表与表的关联 |
| 约束 | 数据的规则(唯一、非空、默认值) |
实战:设计一个用户表、一个订单表
2. SQL 查询
| 操作 | SQL 关键字 |
|---|---|
| 查询 | SELECT |
| 插入 | INSERT |
| 更新 | UPDATE |
| 删除 | DELETE |
| 条件 | WHERE |
| 排序 | ORDER BY |
| 分组 | GROUP BY |
| 聚合 | COUNT/SUM/AVG/MAX/MIN |
3. 索引(核心)
为什么需要索引?
无索引:逐行扫描 → 10万行 = 10万次 IO
有索引:B+Tree 定位 → 10万行 ≈ 3次 IO
| 索引类型 | 说明 | 适用场景 |
|---|---|---|
| 主键索引 | 自动唯一,非空 | 主键字段 |
| 唯一索引 | 字段值唯一 | username、email |
| 普通索引 | 加速查找 | 常用查询字段 |
| 复合索引 | 多字段组合 | 多条件查询 |
| 全文索引 | 文本搜索 | 文章内容搜索 |
最左前缀原则:复合索引 (a, b, c) 能命中 a、a+b、a+b+c,不能命中 b、c
4. 事务(核心)
什么是事务?
事务 = 一组 SQL 操作,要么全部成功,要么全部失败
转账场景:
1. A 账户 -1000
2. B 账户 +1000
必须一起成功或一起失败
ACID 特性
| 特性 | 说明 |
|---|---|
| Atomic(原子性) | 不可分割,要么全成功要么全失败 |
| Consistency(一致性) | 事务前后数据状态一致 |
| Isolation(隔离性) | 并发事务互不干扰 |
| Durability(持久性) | 提交后数据永久保存 |
隔离级别
| 级别 | 脏读 | 不可重复读 | 幻读 |
|---|---|---|---|
| 读未提交 | 有 | 有 | 有 |
| 读已提交 | 无 | 有 | 有 |
| 可重复读 | 无 | 无 | 有 |
| 串行化 | 无 | 无 | 无 |
MySQL 默认:可重复读(RR) PostgreSQL 默认:读已提交(RC)
5. 查询优化
为什么要优化?
慢查询是数据库性能的最大杀手。一个没有索引的查询可能让整个系统变慢。
如何发现慢查询?
-- MySQL:开启慢查询日志
SHOW VARIABLES LIKE 'slow_query_log';
SELECT * FROM slow_log ORDER BY start_time DESC LIMIT 10;
-- PostgreSQL:查看慢查询统计
SELECT * FROM pg_stat_statements ORDER BY total_time DESC LIMIT 10;
-- 使用 EXPLAIN 分析查询
EXPLAIN SELECT * FROM users WHERE username = 'test';
核心优化思路
- 加索引 → WHERE 条件字段必须有索引
- **避免 SELECT *** → 只查询需要的字段
- 避免函数运算 → WHERE YEAR(created_at)=2024 改为 WHERE created_at >= '2024-01-01'
- 分页优化 → 大偏移量用游标分页(WHERE id > last_id)
What ships with it
6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago Changed be5db4d1cf0b
- 2mo ago Changed · -11 lines 393165c924eb
- 2mo ago First seen · 232 lines · 101 tokens per session scan A 2f764dc945c0
database-learning-skill is a skill published in the GitHub repository jiushiwon/wg-skills (154 stars, last pushed 6d ago), licensed Apache-2.0. It adds 101 tokens to every session and 1,897 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-07.
database-learning-skill compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| database-learning-skilljiushiwon/wg-skills | Skill | 154 | 6d ago | Apache-2.0 | A | 101 | Claude Code, Codex |
| postgresql-table-designwshobson/agents | Skill | 43k | 6d ago | MIT | A | 37 | Claude Code |
| db-repairgarrytan/gbrain | Skill | 34k | today | MIT | A | 96 | Claude Code |
| dsqlawslabs/agent-plugins | Skill | 953 | today | Apache-2.0 | A | 247 | Claude Code |
| volcengine-rds-postgresqlbytedance/agentkit-samples | Skill | 496 | 5d ago | Apache-2.0 | A | 63 | Claude Code, Codex |
| postgresdbericrisco/rsc-harness | Skill | 682 | 5d ago | MIT | A | 91 | Claude Code, Codex |
| analyzing-insights-across-teamsPostHog/posthog-foss | Skill | 733 | today | MIT | A | 115 | Claude Code, Codex |