relational-database-design

v2026.09.24

Distills a logical relational-database design methodology into rules an agent applies while designing or reviewing a schema. Covers the design sequence (mission → tables → fields → keys → relationships → business rules → views → integrity review), one-subject-per-table decomposition, atomic single-valued fields, candidate/primary/foreign keys, relationship types with deletion rules and participation, the four levels of data integrity, database-vs-application business rules, validation tables, views for derived data, and the flat-file / spreadsheet / RDBMS-driven antipatterns to avoid. The structure is logical and RDBMS-agnostic, and normalized by construction. Use when designing a new relational schema, reviewing or refactoring an existing one, resolving redundant or repeating data, choosing keys, modeling relationships, or deciding where a constraint belongs.

GitHub
安装命令
npx skhub add pproenca/relational-database-design
Markdown
SKILL.md

Relational Database Design

A logical, RDBMS-agnostic method for designing sound relational databases — the decisions a schema forces and how a disciplined logical-design methodology settles them, written so an agent applies them while designing or reviewing a schema. Each rule names a specific wrong default it corrects; there is no rule for things the model already gets right.

The whole method produces the logical structure first — the tables, fields, keys, relationships, and integrity rules an organization's information requires — deliberately independent of any particular RDBMS product or physical/performance concern. Followed faithfully, it yields fully normalized tables without treating normalization as a separate back-end phase.

When to Apply

  • Designing a new relational schema from requirements
  • Reviewing or refactoring an existing schema for structural soundness
  • Resolving repeating groups, multivalued/multipart fields, or redundant data
  • Choosing candidate, primary, and foreign keys for a table
  • Modeling one-to-one, one-to-many, many-to-many, or self-referencing relationships
  • Deciding deletion rules (restrict, cascade, nullify, deny, set default) and participation constraints
  • Deciding where a constraint belongs — field spec, relationship, validation table, or application
  • Diagnosing a schema that duplicates, loses, or corrupts data

This skill covers logical design. It does not cover SQL dialects, indexing, partitioning, query tuning, or analytical/dimensional (star-schema) modeling — those are physical/implementation concerns handled after the logical design is sound.

Rule Categories

#CategoryPrefixCovers
1Design Process & Requirementsproc-Design logically before choosing an RDBMS, follow the sequence, drive from mission + analysis, normalization is built in
2Table Structuretbl-One subject per table, the ideal table, no reference fields, minimal redundancy
3Field Designfld-The ideal field, single values, atomic fields, no stored calculations, clear names
4Keyskey-Candidate key elements, one primary key per table, foreign keys mirror primary keys, stable non-sensitive keys
5Relationshipsrel-Junction tables for many-to-many, foreign-key placement, deletion rules, participation, self-referencing
6Data Integrity, Rules & Viewsintg-The four integrity levels, field specifications, database-vs-application rules, validation tables, views
7Antipatternsanti-Flat-file, spreadsheet-as-database, RDBMS-driven design, when bending the rules is defensible
8Terminologyterm-Data vs information, nulls, core relational vocabulary

Quick Reference

1. Design Process & Requirements

2. Table Structure

3. Field Design

4. Keys

5. Relationships

6. Data Integrity, Rules & Views

7. Antipatterns

8. Terminology

How to Use

Read a reference file when its decision comes up. Each rule names the wrong default it corrects, then shows the canonical way (with an incorrect/correct contrast only where the wrong way is a real trap).

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and source references
发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

Sep 24, 2026

分类

未分类

许可证

MIT

源路径

skills/.experimental/relational-database-design

默认分支

master

最新提交

cf93c57

Tree SHA

afbb575