10

I'm making an ERD of my database, and am stuck with a little dilemma.

Consider the tables foo and bar. foo has three columns that are foreign keys, referencing to bar's primary key. My question is: in the ERD do I represent this with just one line between those two tables, or do I use three lines?

Neko
  • 3,550
  • 7
  • 28
  • 34

3 Answers3

8

Three lines, like this:

enter image description here

Branko Dimitrijevic
  • 50,809
  • 10
  • 93
  • 167
6

Extending the accepted answer I am giving an example showing when multiple "lines" (relationship) are necessary for same attribute .
Suppose, there is an e-commerce site . customers can register there & they can send gifts to other registered customers. So, there are two relations between customer and gift entity.

enter image description here

First relation: customer gives gift
Second relation: customer receives gift
That's why we need two lines here.You need to consider all the relations & according to that you need to draw lines. As you have three relations you need to draw three lines.

Utshaw
  • 4,166
  • 3
  • 20
  • 25
3

Use three lines. It is used one line per relationship.

PS: It is perfectly ok to have many columns reference the same column in another table. For example you can have a Person table and a Sports table and in the Person table you can have 3 columns such as FavouriteIndividualSport, FavouriteTeamSport, FavouriteExtremeSport

Mosty Mostacho
  • 42,742
  • 16
  • 96
  • 123