| name | relational-database-design |
| description | 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. |
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
| # | Category | Prefix | Covers |
|---|
| 1 | Design Process & Requirements | proc- | Design logically before choosing an RDBMS, follow the sequence, drive from mission + analysis, normalization is built in |
| 2 | Table Structure | tbl- | One subject per table, the ideal table, no reference fields, minimal redundancy |
| 3 | Field Design | fld- | The ideal field, single values, atomic fields, no stored calculations, clear names |
| 4 | Keys | key- | Candidate key elements, one primary key per table, foreign keys mirror primary keys, stable non-sensitive keys |
| 5 | Relationships | rel- | Junction tables for many-to-many, foreign-key placement, deletion rules, participation, self-referencing |
| 6 | Data Integrity, Rules & Views | intg- | The four integrity levels, field specifications, database-vs-application rules, validation tables, views |
| 7 | Antipatterns | anti- | Flat-file, spreadsheet-as-database, RDBMS-driven design, when bending the rules is defensible |
| 8 | Terminology | term- | 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