Greg Gum
Greg Gum

Reputation: 37939

parent child relationship vs linking table

I have a project management database structure which is modeled on a parent/child structure.

item (id,parentId)

However, I am told that I should be using a linking table instead.

item(id)

linkingtable(parentId,childId)

Currently, there is no requirement that the items can be linked many to many, so I do not see any benefit.

Am I missing anything?

I am a c# programmer, not a database designer, so want to make sure of what I am doing here.

Upvotes: 0

Views: 249

Answers (1)

Ubercool
Ubercool

Reputation: 1021

IMHO if there is a slightest possibility of making the relation ManyToMany in future than you should go for association or intermediate table.

But if you are sure that this relation is pure ManyToOne then no need to create additional table.

Upvotes: 1

Related Questions