Many to Many relationships - Brands & Models

Hi Community, I'm trying to create a system, that allows me to easily assign Brands and Models to Products and spare parts, to make it easier for the support teams and sales team to find related products. For the "main" products i.e a laptop, this is easy enough, i.e Brand: Lenove, Model: Thinkpad 4

 

However, now that I'm looking at spare parts the same logic becomes much more difficult i.e a charging cable. The charging cable might be suitable for Lenove Laptops and Asus Laptops and multiple models of each. 

 

How do I assign multiple brands and models to that charger? The only options I see is to create merged brands and model i.e "Asus, Lenovo", however I am worried that this will get very messy very quickly and impossible to maintain as new products get added to the inventory... 

 

In the perfect world, I would like to be able to open any product and have a filtered list by (product brand and product model) on the same page, which will display all spare parts and accessories that is compatible with that product. 

 

Does anyone else face similar issues? Maybe I'm just overthinking it all and there is a really easy solution to it :)!

 

Thank you in advance!

 

Julia 

 

 

Like 0

Like

3 comments

Hello!

Thank you for the detailed description of the problem. The implementation you described assumes the use of a many-to-many relationship, which cannot be supported directly in the relational database structure.


Please note that in relational databases, the many-to-many relationship cannot be directly implemented because it violates the principles of the relational model, which is based on atomic data and normalization. Instead, such relationships are resolved using an intermediate (junction) table.

These are tables that reference two other tables and define the relationships between them. For instance, if we have Table 1 and Table 2, and we need to establish a multi-relationship between them (e.g., linking a record in Table 1 to multiple records in Table 2), we would create a junction table. This table would contain references to both tables and define the dependencies.

This approach allows us to implement a multi-selection mechanism, such as associating a product with multiple brands or categories (e.g., one product having three or more associated brands).

 

Here’s an example of how the table could look:

CompatibilityID    ProductID    BrandID
1                             101                1
2                             102                1

3                             101                2

Thank you Arsenii Ostapyk, that seems like it may be the solution to my problem. I have done a search through Creatio Academy for "junction" or "junction table". Can you point me in the right direction on where I can find information on how I go setting this up?

 

Julia Molnar,

 

Please note that we do not have any instructions or examples for this, since the question relates to the general Database structure principles, rather than to the Creatio system functionality. However, you are welcome to use the public open sources for more in-depth details on the subject.

Show all comments