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.01965 |
| Opus 5 | $0.00051 | $0.00983 |
| Sonnet 5 | $0.00020 | $0.00393 |
| Haiku 4.5 | $0.00010 | $0.00197 |
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 5d 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 — 232 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. 查询优化
慢查询分析
-- 开启慢查询日志
SHOW VARIABLES LIKE 'slow_query_log';
-- 查看慢查询
SELECT * FROM slow_log ORDER BY start_time DESC LIMIT 10;
-- 使用 EXPLAIN 分析查询
EXPLAIN SELECT * FROM users WHERE username = 'test';
优化技巧
- **避免 SELECT *** → 只查询需要的字段
- 避免函数运算 → WHERE age * 2 > 30 改为 WHERE age > 15
- 避免隐式转换 → '123' vs 123
- 使用索引 → 确保 WHERE 条件有索引
- 分页优化 → SELECT * FROM users LIMIT 100000, 10 改为 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.
- 5d 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 (102 stars, last pushed 2d ago), licensed Apache-2.0. It adds 101 tokens to every session and 1,965 once invoked, about $0.0005 per session on Opus 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.
Other skills, from other repositories
alloydb-basics
Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.
postgresql-table-design
Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.
db-repair
Auto-fix gbrain's Postgres access so the brain stays available. When any gbrain command or MCP tool result carries a GBRAINDBACCESS marker (or an operator reports the brain database is down), run the hardcoded gbrain db-repair ladder: diagnose, apply the safe tier, verify. The action is ALWAYS the hardcoded command …
volcengine-rds-postgresql
A tool for operating PostgreSQL databases hosted by Volcano Engine's managed database service. PostgreSQL is a relational database used to store structured application data.
dsql
Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, foreign key…
polar-local-environment
This skill should be used when setting up or managing Polar local development environment with Docker.