From aj-geddes-useful-ai-prompts-4
Design database schemas with normalization, relationships, and constraints for PostgreSQL and MySQL. Use when creating tables or planning data models.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aj-geddes-useful-ai-prompts-4:database-schema-designThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
Design scalable, normalized database schemas with proper relationships, constraints, and data types. Includes normalization techniques, relationship patterns, and constraint strategies.
PostgreSQL - Eliminate Repeating Groups:
-- NOT 1NF: repeating group in single column
CREATE TABLE orders_bad (
id UUID PRIMARY KEY,
customer_name VARCHAR(255),
product_ids VARCHAR(255) -- "1,2,3" - repeating group
);
-- 1NF: separate table for repeating data
CREATE TABLE orders (
id UUID PRIMARY KEY,
customer_name VARCHAR(255),
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE order_items (
id UUID PRIMARY KEY,
order_id UUID NOT NULL,
product_id UUID NOT NULL,
quantity INTEGER NOT NULL,
FOREIGN KEY (order_id) REFERENCES orders(id) ON DELETE CASCADE
);
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| First Normal Form (1NF) | First Normal Form (1NF) |
| Second Normal Form (2NF) | Second Normal Form (2NF) |
| Third Normal Form (3NF) | Third Normal Form (3NF) |
| Entity-Relationship Patterns | Entity-Relationship Patterns |
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4Designs PostgreSQL/MySQL schemas with normalization (1NF-3NF), relationships, constraints, audit columns. For new databases, reviews, migrations, or fixing missing PKs/FKs, wrong types, denormalization, EAV.
Designs or documents database schemas with entity relationships, table definitions, constraints, indexes, and access patterns. Produces structured schema documents for review and migration planning.
Designs normalized (3NF) relational database schemas with indexes, constraints, naming conventions, and documentation from functional requirements. Guides entity extraction, relationships, and ERD generation.