Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7514739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:35:33+00:00 2026-05-30T00:35:33+00:00

Assume you have the same data model as described here . Table: Item Columns:

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:35:34+00:00Added an answer on May 30, 2026 at 12:35 am

    Change the Tag table and add a TagSynonym table:

    Table: Tag
    Columns: TagID
    
    Table: TagSynonym
    Columns: TagID, Title
    

    The TagSynonym.TagID would be an FK to Tag(TagID) and the Title would be the PK.


    If you also want to have a “MainSynonym” tag, then you could use this:

    Table: Tag
    Columns: TagID
    
    Table: TagSynonym
    Columns: TagID, Title
    
    Table: TagMainSynonym
    Columns: TagID, Title
    

    with TagMainSynonym(TagID) being the PK and TagMainSynonym(TagID, Title) being an FK to TagSynonym(TagID, Title).

    It may look overdue but a simple operation like merging two tags will only need a simple UPDATE (one row) on the Tag.TagID and the cascading effects will do the rest (in 3 tables)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume I have the following style table, col1 col2 and col3 have same value
I have my old data model, my new model (same but with two more
In SQL Server assuming one has columns that need to have the same data
Let's assume we have two arrays of the same size - A and B
Assume that we have N erlang nodes, running same application. I want to share
Assume I have a two tables, A and B. Table A has a primary
I need to perform the following on MySQL/InnoDB. Assume I have a table consists
Assume I have a page with a data grid bound to a data source.
Assume I have a class foo, and wish to use a std::map to store
Assume I have created a compiled re: x = re.compile('^\d+$') Is there a way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.