Forum Discussion

Revati25's avatar
Revati25
Icon for Advocate I rankAdvocate I
1 year ago
Solved

Many- Many Relationship

I am trying to create a relationship with 2 tables having multiple id, it is giving many to many how to avoid this and on applying joins the calculations are getting altered, what is the possible rea...
  • bhanu_gautam's avatar
    1 year ago

    Revati25 

    Identify Unique Keys: Ensure that each table has a unique key that can be used to create a one-to-many relationship. If the tables do not have unique keys, you may need to create a composite key by combining multiple columns to form a unique identifier.

    Bridge Table: Create a bridge table (also known as a junction table) that contains unique combinations of the IDs from both tables. This bridge table can then be used to create one-to-many relationships with the original tables.

    Data Modeling: Properly model your data to avoid many-to-many relationships. This might involve restructuring your tables or creating additional tables to ensure that relationships are one-to-many or many-to-one.