Results 1 to 15 of 15
  1. #1
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts

    Triple many to many relationship

    Friends, I am having difficulty creating a relationship of tables in a database.

    I have a table and another table technology company. For each technology has several companies,
    and for each company have different technologies. A many to many.
    I created a join table to resolve this issue, with two foreign keys.

    I have another table Product, and for each company I have several products, and for each technology I also have
    various products.

    Any help is welcome.

    Thank you.

  2. #2
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    What seems to be the problem?

    I never think in terms of tables. I always start with a UML class model for the database. In this case, you have a Product class that has a many to many association with a Technology Class and a many to many association with a Company class. When converting these associations to implement them in a relational database, each of the many to many associations needs to be represented by its own table, just like in your first case.
    Last edited by ruirib; 2012-04-30 at 20:02.

  3. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-05-01)

  4. #3
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    ruirib, thanks for respoding and help.

    I was a little confused by your explanation, but I think that maybe I just need to make a relationship
    a table for many technology products for the table.



    I'm confused, because I would do the record companies, technologies and products through cascading combobox.

    Thank you.

    ps: Sorry indiscretion, I saw that you are located in Portugal. Do you speak Portuguese?

  5. #4
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    In practical terms you will need a Technology_Products table and Company_Products table, besides your base Technology, Products and Company tables (of course you also have the Technology_Company table that I think you mentioned before).

    Fabio, I am Portuguese, so yes, do speak the language .

  6. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-05-01)

  7. #5
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    Obrigado. Vou tentar fazer como você me explicou.

    Eu sou brasileiro. Estou estudando inglês sozinho( mas ainda estou no básico, eu uso o tradutor do google).
    Last edited by fabiobarreto10; 2012-05-01 at 11:47.

  8. #6
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    Translating: Fabio just said he'll try to do as I suggested.

    Sorry, Fabio, for our global audience, we need to use English as the language when posting on the forum.


    P.S.: Eu percebi que é brasileiro . Temos de usar Inglês, aqui no fórum, para que todos os visitantes possam entender o que escrevemos . Boa sorte com o projecto.

  9. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-05-01)

  10. #7
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    Yes, sorry.

  11. #8
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    Not a problem.

    If there are language issues, do drop me a PM and I will help with the translation as best as I can .

  12. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-05-01)

  13. #9
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    Ok, thank you.

  14. #10
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    ruirib, I managed to solve the problem of relations, in fact, I only need a one to many relationship table
    technology products for the table.
    Thank you for helping.

  15. #11
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    Where do I put the topic as solved?

  16. #12
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    There is no way to do that. You just said it was over .

  17. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-05-03)

  18. #13
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    ruirib, just do not understand the second sentence. the translation was not clear to me.

  19. #14
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    I meant that you said it was solved, so that pretty much does it .

  20. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-05-03)

  21. #15
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    ok, now I understand. Thank you again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •