-1

Which is better?

Table: Words
Columns: ID, Word, ParentWordID, CatID

Table: Categories
Columns: CatID, Category

Or:

Table: Words
Columns: ID, Word

Table: Categories
Columns: CatID, Categories

Table: Cat1
Columns: WordID
...
Table: CatN
Columns: WordID

One possible advantage for the 2nd option is that not all Words need to have a category. But the same could be said for ParentWordID, which is empty most of the time. Maybe that too could be replaced with a Parents table and a table for each parent?

1
  • Option is also good.What is the diffrence between option 1 and junction table ?Option is little denormalise
    – KumarHarsh
    Commented Apr 29 at 9:33

1 Answer 1

1

Neither. Use a junction table to model a many-to-many relationship.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.