ER diagram template
Six entities in crow's foot notation, primary and foreign keys filled in, and a junction table already resolving the many-to-many that every first draft gets wrong.
Notation: ER - crow's footDiagram: Entity-relationship diagram
Open this template in Archyno
It opens as an editable model, not an image. Change it in the browser, then export to PNG, SVG, Mermaid, XMI, or a Sparx .qea file.
Open this templateWhat is on this diagram
- Customer
- The party. Its primary key is the one every other table borrows.
- Order
- The transaction. Carries customer_id as a foreign key.
- OrderLine
- The lines. Two foreign keys, because it belongs to two parents.
- Product
- The catalogue entry an order line points at.
- ProductCategory
- The junction. This is how a many-to-many is actually stored.
- Category
- The grouping. Reached only through the junction, never directly.
How to make it yours
- Rename the entities to your nouns, singular. A table called Orders and an entity called Order are different levels.
- Check every crow's foot before you touch an attribute - cardinality is the part a schema cannot fix later.
- Keep one primary key per entity and mark every foreign key. An unmarked FK is a join nobody can find.
- Leave the junction entity in place if you have any many-to-many. Deleting it does not remove the problem.
- Add the nullable columns last, and make the decision explicit for each one.
Common questions
What is crow's foot notation?
The cardinality notation where the end of a relationship line carries a symbol reading as a pair: a bar for one, a three-pronged foot for many, and a circle for optional. It is the notation almost every database tool draws, and it is what this template uses.
How do I model a many-to-many relationship?
With a third entity between the two, carrying a foreign key to each. A relational database cannot store a many-to-many any other way, so drawing the line directly hides work rather than saving it. This template ships that junction already resolved.
Is an ER diagram the same as a UML class diagram?
No. They look similar and describe different things: an ER diagram describes data at rest, with keys and cardinality, and a class diagram describes objects with behaviour and inheritance. A class diagram has operations and an ER diagram never does.
Read the notation
ER diagrams
How to read and draw an entity-relationship diagram: entities, attributes, primary and foreign keys, relationships and cardinality in crow's foot notation, the conceptual-logical-physical progression, and how an ER model differs from a UML class diagram.
Crow's foot notation
The crow's foot cardinality symbols in full: one, many, zero, and the pairs they form; which end of the line each symbol constrains; identifying versus non-identifying relationships; resolving many-to-many; and how crow's foot compares with Chen and with UML multiplicity.
Schema design
Turning an ER model into a schema a database will accept: choosing keys, normalizing to third normal form with a worked example, when denormalization is justified, implementing inheritance, and generating DDL from the diagram.