designing-database-schemas

Define normalized relational schemas with keys, constraints, and indexes for PostgreSQL and MySQL.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/somachak/claude-code-skills-db --skill designing-database-schemas-somachak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: designing-database-schemas
Source: https://github.com/somachak/claude-code-skills-db/tree/main/skills/data/designing-database-schemas
Command: npx skills add https://github.com/somachak/claude-code-skills-db --skill designing-database-schemas-somachak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing robust relational schemas with correct keys, constraints, and normalization tradeoffs to prevent data anomalies and enable scalable storage.

Core Features & Use Cases

  • Guidance on normal forms (3NF/BCNF), primary/foreign keys, NOT NULL, unique constraints, and indexing strategies for common access patterns.
  • Practical decision framework for PostgreSQL and MySQL backends and for Node.js or Python data access layers.
  • Use Case: when creating a new domain model or table, apply this skill to define structure, constraints, and performance considerations.

Quick Start

Outline the table’s primary key, required constraints, and an indexing strategy for common queries.

Frequently Asked Questions about designing-database-schemas

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a relational database schema that prevents data anomalies?

Designing a normalized relational schema prevents data anomalies by applying 3NF/BCNF frameworks with appropriate primary keys, foreign keys, and NOT NULL constraints. This isolates data logically to maintain integrity and support scalable storage across PostgreSQL and MySQL backends.

What is the best way to plan indexing strategies for common database access patterns?

Planning indexing strategies for common database access patterns involves mapping frequent queries against table structures. Define targeted indexes based on primary keys and common lookup columns to optimize data access performance while maintaining write efficiency in PostgreSQL or MySQL.

How do I apply BCNF normalization when defining tables in PostgreSQL or MySQL?

Applying BCNF normalization when defining tables in PostgreSQL or MySQL involves ensuring every determinant in a table is a candidate key. This eliminates overlapping candidate keys and transitive dependencies to prevent update, insertion, and deletion anomalies.

Do I need versioned migrations for a new relational schema design?

You need versioned migrations for a new relational schema design to ensure maintainable data access. Versioned migrations track structural changes across PostgreSQL or MySQL backends, enabling safe deployments and rollback capabilities as the domain model scales.

Can I use this schema design approach for Node.js or Python data access layers?

You can use this schema design approach for Node.js or Python data access layers. The framework provides practical guidance on structuring normalized schemas, constraints, and indexing strategies that integrate seamlessly with Node.js or Python application backends.