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 632127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:02:32+00:00 2026-05-13T20:02:32+00:00

I’ve got a list of synonyms and need to create a database in SQL

  • 0

I’ve got a list of synonyms and need to create a database in SQL for it.

I was thinking about using a Relational Database Design, but don’t know if it would be the best. There will be a decent amount of traffic using this database.

I was thinking about Table1 would be like

Id

Table2
Id
InterlinkID (Table1 Id)
Word

Would this be the best way? There could be 1 – 20+ linked words. One other problem I see from this setup is If I have 1 word that works as a synonym for more than one word.

Not so great Example of how it will be used, but you get the idea:


    Table 1
    Id 1 
    Id 2

    Table 2
    Id 1
    InterlinkID 1
    Word One
    Id 2
    InterlinkID 1
    Word 1
    Id 3
    InterlinkID 1
    Word First
    Id 4
    InterlinkID 2
    Word Two
    Id 5
    InterlinkID 2
    Word 2
    Id 6
    InterlinkID 2
    Word Second

  • 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-13T20:02:32+00:00Added an answer on May 13, 2026 at 8:02 pm

    The most minimal way of modeling the relationship would be as a single table with three columns:

    • id – primary key, integer
    • word – unique word, should have a unique constraint to stop duplicates
    • parent_id – nullable

    Use the parent_id to store the id number of the word you want to relate the current word to. IE:

    id  |  word  |  parent_id
    ---------------------------
    1   | abc    |  NULL
    2   | def    |  1
    

    …shows that abc was added first, and def is a synonym for it.

    A more obvious and flexible means of modelling the relationship would be with two tables:

    1. WORDS

      • id, primary key
      • wordvalue
    2. SYNONYMS

      • word_id
      • synonym_id

    Both columns in the SYNONYMS table would be the primary key, to ensure that there can’t be duplicates. However it won’t stop duplicates in reverse order. But it will allow you to map numerous combinations to have a “spider web” relationship between words, while the single table format would only support a hierarchical relationship.

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

Sidebar

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.