eCommerce database (ERD)

Comparing this against the DBML version of the same schema is the fastest way to see what each format is for.


#What this example shows

  • Four entities with their keys marked.

  • A join entity drawn explicitly.

  • Relationships that state both ends.


#A worked example

Open it, edit it, or copy the source below.

eCommerce database (ERD)

The source, which you can paste into a new diagram and edit:

[Customer]
*id
email
name
tier

[Order]
*id
+customer_id
status
total
placed_at

[Product]
*id
sku
name
price

[OrderItem]
*id
+order_id
+product_id
quantity
unit_price

Order *--1 Customer
OrderItem *--1 Order
OrderItem *--1 Product

#Making it your own

  • A join entity deserves to be drawn; it has its own columns.

  • Keep attribute lists short. This is documentation, not a schema dump.

  • Compare with the DBML example to see which format suits your purpose.



Four symbols, and that is the language.