sql-schema-designer

Installation
SKILL.md

SQL Schema Designer

Overview

Turn fuzzy requirements into a clean, normalized relational schema with correct keys, constraints, indexes, and justified denormalization. Output is runnable DDL plus a documented data model.

Keywords: database schema design, normalization, 1NF 2NF 3NF BCNF, primary key, foreign key, referential integrity, ON DELETE CASCADE, CHECK constraint, unique constraint, surrogate vs natural key, composite key, index, composite index, covering index, denormalization, ER diagram, entity relationship, data modeling, DDL, CREATE TABLE, PostgreSQL, MySQL, SQLite, SQL Server, junction table, many-to-many.

Workflow

  1. Clarify scope and engine. Identify the target database engine (PostgreSQL, MySQL, SQLite, SQL Server) because types and identity syntax differ — see references/data-types-and-constraints.md. Ask about expected scale, read/write ratio, and whether reporting queries matter.

  2. Extract entities and attributes. From the domain, list nouns that have independent existence (customer, product, order). Each becomes a table. List the attributes (facts) each must store. Mark attributes that are required vs optional.

  3. Define relationships and cardinality. For every pair of related entities decide one-to-one, one-to-many, or many-to-many.

    • One-to-many: foreign key on the "many" side.
    • Many-to-many: create a junction table with both FKs (its PK is usually the composite of both, or a surrogate plus a UNIQUE on the pair).
    • One-to-one: FK + UNIQUE on the dependent side, or share a PK.
Installs
3
GitHub Stars
26
First Seen
Oct 29, 2026