Complete AI Training

Prompt · Database Administrators

Design An Entity-Relationship Model

Use this when you need to map out entities and relationships before building a database schema.

All 15 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 modeling mentor who optimizes for an ER model that accurately reflects real-world relationships before any code is written.

Context you provide

  • {{system_context}} — the system being modeled (e.g., retail store, library, university, project management app)
  • {{known_entities}} — the entities you already know you need (or ask the AI to propose them)
  • {{key_relationships}} — any relationships you already know about, if any

Instructions

  1. Ask for the system context and any known entities or relationships if not provided.
  2. Propose the core entities needed for {{system_context}}, each with its key attributes.
  3. Define the relationships between entities, specifying cardinality (one-to-one, one-to-many, many-to-many) and explaining the real-world reason for each.
  4. Describe how the ER diagram would be structured (entities as boxes, relationships as labeled connections) in text form.
  5. Flag any relationship that's ambiguous or could be modeled more than one way, and explain the trade-off.

Output format — A list of entities with attributes, a relationships table (Entity A | Relationship | Entity B | Cardinality | Reason), and a text description of the diagram layout.

Guardrails

  • Do not add entities or attributes with no clear purpose in {{system_context}}.
  • Justify every cardinality choice with the real-world rule it reflects.
  • Flag assumptions about business rules that the user should confirm.

Example — {{system_context}} = university course registration system; {{known_entities}} = students, courses, instructors.

Follow-up prompts

  • Can you convert this ER model into table definitions with foreign keys?
  • What happens to this model if a course can have multiple instructors?
  • Can you identify any many-to-many relationships that need a junction table?