What is an ER diagram?
An entity-relationship diagram shows the tables in a database, their key fields and how they relate. This example models a small online shop — customers place orders, orders contain items, items point to products and each order has a payment — which is a good starting point for most e-commerce or booking schemas.
When to use it
- Designing a database before writing migrations.
- Explaining an existing schema to a new developer.
- Teaching or revising database normalisation.
How to make an ER diagram in SketchFlow
- Step 1: Open the ER diagram template in SketchFlow.
- Step 2: Rename the entities and edit the field lists inside each box (one field per line).
- Step 3: Mark primary keys with PK and foreign keys with FK.
- Step 4: Draw arrows between related entities and label them with the cardinality, such as 1:N.
- Step 5: Export as SVG for crisp documentation or PNG for a ticket.
Tips for a better result
- Name entities as singular nouns: Order, not Orders.
- Put the 'many' side's foreign key in its field list so the relationship is visible.
- Keep this diagram conceptual; generate the exact schema from your migrations.
Questions about this template
What is an ER diagram?
An entity-relationship diagram is a model of a database: boxes are entities (tables), lines are relationships, and each box lists its attributes (columns).
What do 1:1, 1:N and N:M mean?
They are cardinalities: one-to-one, one-to-many and many-to-many. A many-to-many relationship usually needs a joining table, like Order item here.
Can SketchFlow generate SQL from the diagram?
No. SketchFlow is a drawing tool; the diagram is for planning and communication, not code generation.