Skip to main content

Technical diagrams

ER diagram template

Entities, key fields and one-to-many relationships for a shop database. Free to use and edit in your browser — no account needed.

ER diagram template previewEntities, key fields and one-to-many relationships for a shop database. Contains: Customer id (PK) name email, Order id (PK) customer_id (FK) created_at, Product id (PK) name price, Order item order_id (FK) product_id (FK) quantity, Payment id (PK) order_id (FK) amount, places 1:N, has 1:N, in 1:N, paid by 1:1.Customer id (PK)nameemailOrder id (PK)customer_id (FK)created_atProduct id (PK)namepriceOrder item order_id (FK)product_id (FK)quantityPayment id (PK)order_id (FK)amountplaces 1:Nhas 1:Nin 1:Npaid by 1:1
Preview of the ER diagram template. On the board every shape, label and arrow is editable.

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

  1. Step 1: Open the ER diagram template in SketchFlow.
  2. Step 2: Rename the entities and edit the field lists inside each box (one field per line).
  3. Step 3: Mark primary keys with PK and foreign keys with FK.
  4. Step 4: Draw arrows between related entities and label them with the cardinality, such as 1:N.
  5. 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.