This ER diagram shows a simple online store system. One customer can place none or many orders. The customer can add one or many products to zero or many orders. They can apply a discount code (if available) to zero or one order.

Simple online store

Online store diagram code in Gleek

Customer
string Customer_id
string Name
int Email

Order
int Order_id
int Product
string Total

Product
int Order_id
int Product
string Total

DiscountCode
int DiscountCode_id
int Value

Customer {1}-places-{0..n} Order
Product {1..n}-is added to-{0..n} Order
DiscountCode {01}-applied to-{01} Order

About ER diagrams

We often make an entity-relationship (ER) diagram, ERD, or entity-relationship model, in the early stages of designing a database. An ERD is perfect for quickly sketching out the elements needed in the system. The ERD explains how the elements interact. ER diagrams can be shared with colleagues. Their simplicity makes them ideal even for non-technical stakeholders.

Similar ER diagram examples

Hospital management system entity-relationship diagram

Simple order process entity-relationship diagram

Store sales system entity-relationship diagram