Prompt · Database Administrators
Design An Entity-Relationship Model
Use this when you need to map out entities and relationships before building a database schema.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- 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
- Ask for the system context and any known entities or relationships if not provided.
- Propose the core entities needed for {{system_context}}, each with its key attributes.
- Define the relationships between entities, specifying cardinality (one-to-one, one-to-many, many-to-many) and explaining the real-world reason for each.
- Describe how the ER diagram would be structured (entities as boxes, relationships as labeled connections) in text form.
- 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?