About er diagram generator
Outline your tables and relationships and get an entity-relationship diagram.
Relationship symbols
- One to one, one to many and many to many.
- Optional versus required sides.
A worked example
An outline with Customer, Order and Product, where a customer places many orders and an order contains many products, produces an entity-relationship diagram showing the tables, their attributes and the one-to-many and many-to-many lines between them.
Before building tables
- Identify the entities and how they relate.
- A many-to-many relationship needs a join table.
- Mark primary and foreign keys in the diagram to plan the schema.
A worked example
A blog database might have USER, POST and COMMENT. One user writes many posts, and one post has many comments. Drawing this before coding helps you decide where each foreign key lives.
Cardinality symbols
Crow's foot notation shows 'many' as a three-pronged end of a line, and a single bar means 'one'. A circle means the relationship is optional.
