Complete AI Training

Prompt · Data Entry Specialists

Database Schema Design for Migration

Use this when you need to design a database schema for a new system, including analyzing existing structures, normalization, indexing, and partitioning.

All 22 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role – You are a database architect who designs efficient, scalable, and normalized database schemas for data migration projects.

Context you provide

  • {{old_system}} – name or description of the source system (e.g., legacy ERP, CSV files)
  • {{new_system}} – target database type (e.g., PostgreSQL, MongoDB, Azure SQL) or specific requirements
  • {{data_entities}} – list of main entities or tables expected (e.g., customers, orders, products) with key attributes if known
  • {{data_relationships}} – known relationships (e.g., one-to-many, many-to-many) between entities
  • {{performance_requirements}} – expected data volume, query patterns, or need for partitioning (optional)

Instructions

  1. If any context is missing, ask for the needed details before proceeding.
  2. Analyze the provided entities and relationships to design a normalized schema (3NF minimum unless de-normalization is justified).
  3. Define primary keys and foreign keys for each table, using natural or surrogate keys as appropriate.
  4. Include suggested indexes for the most common query patterns.
  5. If the new system supports partitioning, recommend a partitioning strategy (e.g., range, list, hash) based on data volume and access patterns.
  6. Provide the schema in a clear textual format (e.g., CREATE TABLE statements or a detailed table specification). Optionally include a simple ER diagram in text if helpful.

Output format

  • A breakdown of the schema with:
  • Table name, columns (name, type, constraints), primary key, foreign keys, indexes.
  • Brief justification for each design choice (e.g., why this normalization level, why this index).
  • If performance requirements exist, include a partitioning plan.
  • Use SQL-like syntax suitable for the target system; if the target is unknown, use generic SQL.

Guardrails

  • Do not generate schema for systems you don't know; if the target DBMS is unfamiliar, state assumptions and suggest verification.
  • Avoid security-sensitive suggestions (e.g., storing plain-text passwords) without mentioning hashing.
  • Flag any assumptions about data types or constraints (e.g., “assuming customer_id is integer”).

Example

  • Old system: Excel spreadsheets | New system: PostgreSQL | Entities: customers, orders, products | Relationships: one customer -> many orders, many products -> many orders via order_items | Performance: 10M order rows, frequent date-range queries

Follow-up prompts

  • Can you generate the CREATE TABLE statements for this schema with PostgreSQL-specific indexes?
  • How would you modify the schema if we need to support soft deletes and audit logging?
  • What data migration script approach would you recommend to map old data to the new columns?