Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aj-geddes avatar

Database Schema Design

  • 521 installs
  • 305 repo stars
  • Updated March 4, 2026
  • aj-geddes/useful-ai-prompts

database-schema-design is a Claude Code skill that generates normalized relational database schemas with constraints and performance considerations for developers planning PostgreSQL or MySQL data models.

About

database-schema-design is a skill from aj-geddes/useful-ai-prompts for designing scalable, normalized relational schemas with proper relationships, constraints, and data types. It covers normalization techniques, relationship patterns, and constraint strategies for PostgreSQL and MySQL. Developers reach for database-schema-design when starting greenfield data models, redesigning tables, or planning indexes and foreign keys before writing migrations. The skill outputs table definitions, relationship diagrams in prose, and constraint recommendations suited to transactional application backends.

  • Covers 1NF through 5NF normalization techniques with concrete SQL examples
  • Designs 1:1, 1:N, and N:N relationship patterns with proper foreign keys
  • Includes constraint, index, and trigger planning for data integrity
  • Provides PostgreSQL and MySQL specific schema patterns
  • Delivers ready-to-apply CREATE TABLE statements and migration guidance

Database Schema Design by the numbers

  • 521 all-time installs (skills.sh)
  • Ranked #121 of 911 Databases skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill database-schema-design

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs521
repo stars305
Last updatedMarch 4, 2026
Repositoryaj-geddes/useful-ai-prompts

How do you design a normalized PostgreSQL or MySQL schema?

Generate properly normalized, relational database schemas for PostgreSQL and MySQL with correct constraints and performance considerations.

Who is it for?

Backend developers designing new relational schemas who need normalization, constraints, and PostgreSQL or MySQL specifics.

Skip if: NoSQL document stores, graph databases, or teams that only need query tuning on an existing schema.

When should I use this skill?

A developer asks to design tables, plan a data model, or create a new PostgreSQL or MySQL schema.

What you get

Normalized table definitions, relationship mappings, constraint specifications, and data-type choices for PostgreSQL or MySQL.

  • Table schema definitions
  • Relationship and constraint specifications

Files

SKILL.mdMarkdownGitHub ↗

Database Schema Design

Table of Contents

Overview

Design scalable, normalized database schemas with proper relationships, constraints, and data types. Includes normalization techniques, relationship patterns, and constraint strategies.

When to Use

  • New database schema design
  • Data model planning
  • Table structure definition
  • Relationship design (1:1, 1:N, N:N)
  • Normalization analysis
  • Constraint and trigger planning
  • Performance optimization at schema level

Quick Start

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
);

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
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 PatternsEntity-Relationship Patterns

Best Practices

✅ DO

  • Follow established patterns and conventions
  • Write clean, maintainable code
  • Add appropriate documentation
  • Test thoroughly before deploying

❌ DON'T

  • Skip testing or validation
  • Ignore error handling
  • Hard-code configuration values

Related skills

How it compares

Pick database-schema-design for greenfield relational modeling; use migration-specific skills when altering existing production schemas.

FAQ

Which databases does database-schema-design support?

database-schema-design targets PostgreSQL and MySQL relational schemas. The aj-geddes/useful-ai-prompts skill produces normalized tables, relationships, constraints, and data-type recommendations for transactional application backends.

When should database-schema-design be invoked?

database-schema-design should be invoked when creating a new database schema, redesigning tables, or planning data models before migrations. The skill emphasizes normalization, relationship patterns, and constraint strategies.

Databasesbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.