Skip to content
flowchart.tools

E-commerce database ER diagram template

Customers, orders, order items, products and payments, generated from SQL.

Use this template
E-commerce database ER diagram template. Every shape, label and connector is editable once it is in the editor.

About this template

An online shop is the textbook relational schema: customers place orders, orders contain line items, line items point at products, and payments settle orders. This entity-relationship diagram shows those five tables with their keys.

The diagram is generated from the CREATE TABLE statements below it. Open the SQL in the SQL to ER diagram tool, add your columns or tables, and the picture updates as you type.

What is in the diagram

orders → customers
Each order belongs to one customer through customer_id.
order_items
The join between orders and products. It stores quantity and the price at the time of purchase.
payments → orders
Kept separate from orders so one order can have several payment attempts.

Guides that use this template