When to use Associative entities?

Associative entities are used when you need a relationship to be involved in a relationship.

For example:

Enrollment relationship ERD

For a normal many-to-many relationship between Student and Course, we would use just a diamond. However, if we want to associate Enrollment with Teacher, we can turn Enrollment into an associative entity.

Enrollment associative entity ERD

Phyiscally, our database looks like this:

Enrollment associative entity tables

Making Enrollment a ternary relationship in which the Teacher is an optional role would have much the same meaning (except it would be denormalized, having a nullable role).

Leave a Comment