database-schema-design

Design normalized PostgreSQL and MySQL schemas with constraints and SQL examples.

6|1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill database-schema-design-repairyourtech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-schema-design
Source: https://github.com/RepairYourTech/cfsa-antigravity/tree/main/.agent/skills/database-schema-design
Command: npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill database-schema-design-repairyourtech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps users design normalized, efficient, and robust database schemas for PostgreSQL and MySQL, ensuring data integrity and scalability.

Core Features & Use Cases

  • Normalization: Guides through 1NF, 2NF, and 3NF to reduce redundancy.
  • Relationship Design: Illustrates one-to-one, one-to-many, and many-to-many relationships.
  • Constraint Implementation: Demonstrates NOT NULL, UNIQUE, CHECK, and FOREIGN KEY constraints.
  • Data Type Selection: Recommends optimal data types for PostgreSQL and MySQL.
  • Schema Evolution: Provides strategies for backward-compatible schema changes.
  • Use Case: When starting a new project, use this Skill to define the core tables for users, products, and orders, ensuring they are properly related and constrained.

Quick Start

Use the database-schema-design skill to create a PostgreSQL schema for a blog with posts and comments.

Frequently Asked Questions about database-schema-design

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

FAQPage Schema
How do I design a normalized database schema for PostgreSQL and MySQL?

To design a normalized database schema, apply 1NF, 2NF, and 3NF strategies to reduce data redundancy. This process details relationship patterns and constraint implementation to ensure robust data integrity and scalability for PostgreSQL and MySQL.

What is the best way to model one-to-many and many-to-many relationships in SQL?

Modeling SQL relationships requires structuring one-to-one, one-to-many, and many-to-many patterns using foreign keys. This approach ensures proper data mapping and enforces relational constraints to maintain data integrity across connected database tables.

How do I implement database constraints like CHECK and FOREIGN KEY for data integrity?

Implement database constraints by applying NOT NULL, UNIQUE, CHECK, and FOREIGN KEY rules directly in your SQL schema. This mechanism enforces strict data validation and relational integrity at the database engine level.

Can I use table partitioning for database schema performance and scalability?

Table partitioning is supported for database schema performance and scalability. This technique divides large tables into smaller segments, optimizing query performance and managing data growth effectively in PostgreSQL and MySQL environments.

What are the strategies for backward-compatible database schema evolution?

Backward-compatible database schema evolution strategies involve applying incremental, non-breaking changes to existing tables. This process maintains application stability during deployments by ensuring older code versions continue interacting with the updated database structure.

How do I select optimal SQL data types for PostgreSQL and MySQL tables?

Selecting optimal SQL data types requires matching column attributes to specific PostgreSQL and MySQL storage engines. This selection process minimizes storage overhead and ensures efficient query execution for your normalized database schema.