Database 2018-07-31

Types of Relationships in ER Diagrams

Understand the three types of ER diagram relationships: dependent (parent-child, solid line), independent (dotted line), and many-to-many. Includes SQL table design examples for each.

Read in: ja
Types of Relationships in ER Diagrams

Overview

This post summarizes the types of relationships in ER diagrams.

Types of Relationships in ER Diagrams

There are three types of relationships in ER diagrams.

Type of Relationship Table Relationship Line Type
Dependent Relationship Child table depends on parent table (parent-child relationship exists between tables) Solid line (Parent → Child)
Independent Relationship Child table does not depend on parent table (no parent-child relationship exists between tables) Dotted line (Parent → Child)
Many-to-Many Relationship Many-to-many table relationship Solid line (Parent ↔ Child)

Dependent Relationship

The child table, User Profile, cannot exist without a record in the parent table, User, so it can be said that the child table depends on the parent table.

Independent Relationship

As explained earlier, the relationship between User and User Profile is a dependent relationship.

The relationship between User and Company is independent because a customer can exist without a user, and vice versa.

Many-to-Many Relationship

This relationship requires a junction (intermediate, pivot) table.

Thoughts

I want to read more books and delve deeper into this topic.

References

Tags: ER
Share: 𝕏 Post Facebook Hatena
✏️ View source / Discuss on GitHub
☕ Support

If you enjoy this blog, consider supporting it. Every bit helps keep it running!


Related Articles