1

I'm using MySQL Workbench for drawing ERD. When connecting tables, I see there are 6 types of relationships. But I don't really know how to use them properly.

enter image description here

In fact my (mis)understanding is:

1:1 In my understanding, database has no 1:1 relationship. why there is this option? and differences between first and third symbol.

1:n Differences from second, fourth and sixth symbol ?

Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
Trần Kim Dự
  • 5,872
  • 12
  • 55
  • 107

1 Answers1

2

In fact, all these different types are just convenience options for a relationship. You can always create any of them, open the relationship editor by double clicking the relationship in the diagram and change it from one type to the other.

I'm not sure what you mean by "database has no 1:1 relationship". Is it that your db has no such relationships or do you believe that a database in general has no such type (which would be wrong).

Hover with the mouse over each button to get a short description of what they do. There is 1:1 and 1:n non-identifying, same for identifying, then n:m (which requires an intermediate table, which is automatically created by MySQL Workbench) and the last on is a special 1:n relationship where you can pick existing columns to take part (in the other cases new columns are automatically created).

Community
  • 1
  • 1
Mike Lischke
  • 48,925
  • 16
  • 119
  • 181