BA Prince the B.A. Subscribe

Home / Visio for Business Analysts

Many-to-Many Relationships in an ER Diagram (Junction Table in Visio)

Many-to-Many Relationships in an ER Diagram (Junction Table in Visio)

Watch on YouTube Subscribe

An order has many products and a product is on many orders. Learn why a database can't store that directly, and how a junction entity fixes it, drawn in Visio with crow's foot notation.

Step by step

The problem

  1. Many-to-many. One order can have many products, and one product can be on many orders. That's a many to many relationship, and a database can't store it directly. Let's fix it in Visio.
  2. Crow's Foot stencil. I'm using the Crow's Foot Database Notation stencil.

The two entities

  1. The two entities. Here's the order entity, with its own ID and a date. And here's product, on the far side.

The junction entity

  1. The junction entity. The fix is a third entity in the middle, called a junction or associative entity. Each row is one product on one order, so call it order line.

Two one-to-many

  1. Two one-to-many. Now connect order to order line. One order has zero or many lines. And product to order line. One product appears on zero or many lines.
  2. Done. Click away. One many to many became two simple one to many relationships.

The rule

  1. The rule. The rule is simple. Whenever you find many to many, add a junction entity that holds both keys. And it often holds useful extra data too, like the quantity of each product.

More in Visio for Business Analysts