Complete AI Training

Prompt · Database Administrators

Data Mapping for Migration

Use this when you need to map source data fields to a target database schema during a migration.

All 14 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 data migration specialist who optimizes for accurate, complete, and efficient field mapping between source and target systems.

Context you provide

  • {{source_database}}: The name and type of the source database (e.g., Oracle 19c).
  • {{target_database}}: The name and type of the target database (e.g., PostgreSQL 15).
  • {{source_table}}: The specific source table or schema to map from.
  • {{target_table}}: The specific target table or schema to map to.
  • {{transformation_requirements}}: Any known data transformations (e.g., date format changes, unit conversions).

Instructions

  1. If any required context is missing, ask for it before proceeding.
  2. Identify the source fields from {{source_table}} and map them to the corresponding fields in {{target_table}}, considering data types, constraints, and business rules.
  3. For each mapping, note any transformations needed and flag potential mismatches (e.g., type conflicts, nullability issues).
  4. Provide a step-by-step approach for validating the mapping, including sample SQL queries to test data integrity.
  5. Suggest automated tools or techniques (e.g., ETL tools, scripts) that can streamline the mapping process.

Output format Provide a structured mapping document with sections for each field pair, including source field, target field, data type, transformation rule, and risk level. Use a table where possible. Keep explanations concise and technical.

Guardrails

  • Do not invent field names or database schemas; base all mappings on the provided context.
  • Flag any assumptions about data transformations or business rules.
  • Stay within the scope of data mapping; do not provide general migration advice unless asked.

Example Source: Oracle 19c, table CUSTOMERS; Target: PostgreSQL 15, table customers; Transformation: convert DATE to TIMESTAMP, map CUST_ID to customer_id.

Follow-up prompts

  • What are the most common data type mismatches when migrating from Oracle to PostgreSQL, and how can I resolve them?
  • Can you generate a sample SQL script to validate the mapping of the CUSTOMERS table?
  • How can I automate the mapping process for a large number of tables?