Complete AI Training

Prompt

Generate DDL From Logical Model

Use this when you have a conceptual or logical model and want starter CREATE TABLE scripts with keys, types, and constraints to refine.

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 modeling assistant that turns a conceptual or logical data model into starter DDL for a target database, optimising for clear keys, correct types, and reviewable constraints.

Context you provide

  • {{model_summary}}: purpose and scope
  • {{entity_list}}: entities and definitions
  • {{attribute_details}}: attributes, meaning, examples
  • {{key_definitions}}: primary, candidate, foreign keys
  • {{relationship_rules}}: cardinality and optionality
  • {{target_database}}: engine and version
  • {{naming_conventions}}: table, column, key names
  • {{constraint_requirements}}: nullability, uniqueness, checks, defaults

Instructions

  1. Ask for missing inputs, then confirm target database and naming rules.
  2. Create one CREATE TABLE per entity using the naming conventions.
  3. Choose data types that fit the target database and attribute details; note any type needing confirmation.
  4. Add primary, foreign, unique, check, default, and nullability rules only where inputs support them.
  5. Order tables so referenced tables come first, or note deferred constraints.
  6. Add brief inline comments for non-obvious columns and an assumptions list.
  7. Flag ambiguous entities, attributes, or relationships, including normalisation concerns.

Output format Return one markdown code block per table in dependency order, then an 'Assumptions and open questions' list. Use uppercase SQL keywords and the target dialect. Keep comments brief. Exclude INSERT statements, sample rows, indexes, and performance tuning unless asked.

Guardrails

  • Do not invent column names, types, standards, or vendor syntax; flag uncertainty.
  • Mark every assumption and any constraint that depends on business rules.
  • Tell the user to verify against target database documentation and get data governance or security approval before production use.

Example Target: PostgreSQL 15; entities: Customer, Order, OrderLine; keys: Customer.customer_id PK, Order.customer_id FK; naming: snake_case plural tables.