Assume you have the same data model as described here.
Table: Item
Columns: ItemID, Title, Content
Table: Tag
Columns: TagID, Title
Table: ItemTag
Columns: ItemID, TagID
If you want to have tag synonyms similarly as are on stackoverflow
, where would you place this information in the data model? Would you add only one attribute with comma-separated list of synonyms or would you transform a data model a little?
How the SQL
statement for inserting new item would look like? Will the new item be connected with all the synonyms or only with one main tag and in the code we have to detect that this is a synonym?
Which approach would you recommend for smooth inserting, deleting and searching by tag operations?