# Relational Schema Design

> Design a correct relational schema: normalize to 3NF, denormalize only with measured evidence and a named consistency cost, push constraints (PK/FK/UNIQUE/CHECK/NOT NULL) into the database, and choose precise data types.

- Skill: `mcorbett51090/relational-schema-design` (Agent Skill)
- Install (CLI): `npx get-skill add mcorbett51090/relational-schema-design`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mcorbett51090/relational-schema-design/raw
- Safety review: pending (external: skill-scanner PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: mcorbett51090 (https://skillmd.com/u/mcorbett51090)
- Updated: 2026-11-19
- Page: https://skillmd.com/skills/mcorbett51090/relational-schema-design

---


# Relational Schema Design

## Normalize first
3NF by default: each fact once, relationships via keys. Most 'we must denormalize' instincts are premature.

## Denormalize deliberately
Only with a measured read benefit AND the write/consistency cost named — often a **materialized view** or **covering index** is better than redundant columns.

## Constraints in the DB
PK on every table, FK for every relationship, NOT NULL/UNIQUE/CHECK to make illegal states unrepresentable. The app is not a trustworthy enforcer.

## Types
Precise numeric/temporal/text; `uuid`/`enum`/`jsonb` where they fit. `text` for everything + naive timestamps are smells.

