Script Valley
Database Design: From Idea to Schema
From Schema to ProductionLesson 6.5

Capstone: designing a complete schema from scratch

end-to-end design workflow, requirements analysis, ER diagram, normalization pass, constraints and types, indexing strategy, migration files, roles, documentation review

The Full Design Process

End-to-End Schema Design Workflow

Good database design is a process, not a single step. Here is the complete workflow you now have the tools to execute.

Step-by-Step

  1. Gather requirements — write them down in plain English. Identify every noun and relationship.
  2. Draw the ER diagram — entities, attributes, cardinality. Use dbdiagram.io or draw.io. Get stakeholder sign-off before writing SQL.
  3. Normalize to 3NF — check every table for 1NF/2NF/3NF violations. Split where needed.
  4. Choose data types and constraints — NOT NULL, UNIQUE, CHECK, DEFAULT, FK with correct ON DELETE behavior.
  5. Plan indexes — every FK, every high-cardinality WHERE column, every sort column on large tables.
  6. Write migrations — one file per logical change, named and versioned.
  7. Apply roles — create app_user, report_user, migration_user with minimum required privileges.
  8. Document — inline SQL comments on non-obvious columns, a README for major decisions.

The Design Mindset

Every schema decision is a tradeoff. Normalization reduces redundancy but adds JOINs. Denormalization speeds reads but risks inconsistency. Soft deletes preserve history but grow tables. There is no universally correct schema — there is only the schema that correctly models your specific domain with the performance characteristics your application requires. Now you can make those tradeoffs deliberately.