ERData modelSimple

E-commerce data model

Entities for customers, orders, line items, products, and payments in an e-commerce app.

E-commerce data model preview

What this diagram shows

Step 01
Customer to order

A customer places many orders — the core one-to-many of any store.

Step 02
Order composition

Each order is made up of line items that reference catalog products.

Step 03
Payment binding

Every order pairs with exactly one payment record.

About er diagrams

Entity-relationship diagrams sketch the shape of a data model: tables, their fields, and how they reference each other. They help when planning schemas or explaining a database at a glance.

This template is written in Mermaid — plain text you can edit, version in git, and regenerate the image from any time.

View Mermaid sourcePlain-text diagram syntax — copy or edit directly.
diagram.mmd
1erDiagram
2 CUSTOMER ||--o{ ORDER : places
3 ORDER ||--|{ LINE_ITEM : contains
4 LINE_ITEM }o--|| PRODUCT : refers
5 ORDER ||--|| PAYMENT : paid_by
6
7 CUSTOMER {
8 uuid id
9 text email
10 text name
11 }
12 ORDER {
13 uuid id
14 timestamp placed_at
15 text status
16 }
17 LINE_ITEM {
18 uuid id
19 int quantity
20 money price
21 }
22 PRODUCT {
23 uuid id
24 text name
25 money price
26 }
27 PAYMENT {
28 uuid id
29 money amount
30 text method
31 }