ER diagram: e-commerce data model
Entity-relationship diagram for an e-commerce platform with crow's foot notation, primary/foreign keys, and join tables.
The prompt
ER diagram for an e-commerce platform using crow's foot notation. Entities and key attributes: Customer (id PK, email unique, name, created_at), Order (id PK, customer_id FK, total_cents, status, placed_at), OrderItem (id PK, order_id FK, product_id FK, quantity, unit_price_cents, with composite unique on order_id+product_id), Product (id PK, category_id FK, name, sku unique, price_cents), Category (id PK, name), ShippingAddress (id PK, customer_id FK, street, city, state, postcode, country). Relationships: Customer has many Orders and many ShippingAddresses. Order has many OrderItems. OrderItem references Product. Product belongs to Category. Show typical indexes on Order.customer_id, Order.placed_at, and Product.category_id.
What it generates
An ER diagram with all entities, attributes, primary and foreign keys, cardinalities, and unique constraints.
When to use it
For documenting a relational data model — onboarding new engineers, planning a schema change, or producing audit-friendly database documentation.
Generate this diagram in seconds
Copy the prompt above, sign in for free, and paste it into the generator.
Related software architecture templates
C4 System Context diagram
Level-1 C4 diagram showing the system, its users, and the external systems it depends on.
Sequence diagram: OAuth 2.0 flow
UML sequence diagram of the authorisation code flow with PKCE, including error handling alt fragments.
Data flow diagram: e-commerce (Level 0)
Level-0 DFD (context diagram) for an e-commerce ordering system with external entities and bidirectional data flows.