Doubt with relation of Mysql tables

Asked

Viewed 44 times

0

Next guys, I have these tables there, I’m studying relationship tables here... This project has no intention, except to practice and study! I linked the table Categories and types to products like 1 for many...

Where a product can have only one category and type... type and category may have several products..

As a product in these 2 case stood on the side of several, so by q learned the foreign key stands on the side of several!

and in the addeds and deletions table is just an add-on to products table.. where stayed in relationship 1 to 1...

My question is how to correctly relate the table updates to the products table! Already q a product can have multiple updates, and table updates can have updates of various products..

I was a little confused, with this scenario... Could someone tell me how it would look? and try to make a summary so I can understand a little better..

thanks to everyone from now on!

Relacionamentos

1 answer

0


Why not a 1-M ratio? The same product can be changed several times, so table entries updates will have a reference to the table entry products to which the amendment refers.

In challenge mode, the same goal can be to treat registrations, removals and changes always in the same table (actions, for example) and differentiate between the various actions by a field.

  • That’s right, I had come to this conclusion tbm, I ended up making relationship from 1 to m! And I changed some things.. I’ve been studying more about modeling.. And I came to the conclusion that some things were out of convention.. Thank you very much for your attention and help..

Browser other questions tagged

You are not signed in. Login or sign up in order to post.