Skip to content

AI ER diagram generator

Describe entities, attributes and cardinality to create an entity relationship diagram. Clarify keys and optional relationships through conversation.

Start a conversation

Create an ER diagram from your entities, fields and relationships. Include known keys and cardinalities, then check the result against your intended data model.

1 → 0..*1 → 1..*1 → 0..*CustomerPK customer_idOrderFK customer_idOrderLineFK order_idProductPK product_id
Illustrative example · Customer, order, line and product relationships

Supply keys and relationship rules

List the attributes that identify each entity and the fields that refer to another entity. Explain mandatory relationships in plain language. “An order must belong to exactly one customer” gives more information than “Customers have orders.”

A many-to-many relationship usually needs an association entity in a relational schema. In the example, OrderLine connects an order and a product, and stores the quantity and price agreed for that line.

Check the model with edge cases

Test a customer with no orders, an order with multiple products and a product that has never been ordered. Decide how canceled or deleted records behave. If an attribute can be missing, say so. Do not infer deletion or cascade rules merely from a connecting line.

Ask “Show optionality at both ends and explain why OrderLine is needed.” Compare the explanation to your business rules before implementing a database migration.

Keep a diagram separate from a live database

The drawing is a model of the information you provide. It does not connect to, inspect or modify your database. Review column types, constraints, indexes and migration safety in your own database tools.

Use a data flow diagram to show how these records move through the application, or an architecture view to locate the database in the wider system.

Make it about your work

Checking your session…

Edit this starting prompt, then send it when you are ready.