Skip to main content
Removed the [relational-theory] tag because it should be used on (a) questions about the relational model itself, not on (b) questions about how to define/represent the conceptual level relationships of a certain database.
Source Link
MDCCL
  • 8.5k
  • 3
  • 31
  • 62
Source Link

MySQL Double many-to-many on an Entity

I have a project where I have Products and SKU's. Each Product has one or many SKU's.

I also have Shops that can have many to many Products, So a Product can belong to multiple Shops and a Shop can have multiple Products.

To finish, each Shop can choose which SKU's they want for which Products. So I as a Shop can choose to sell the Tshirt White, which may have (XS,S,M,L) and I can choose (XS,S) as SKU's I want for my Shop.

Currently

As you can see A Shop is connected to the Products, and to the SKU's. But I have a feeling there's something wrong

My shop_skus and shop_products are not connected, So there can be a mismatch between the products a shop has, and the sku's..

How would I go about fixing that?

Thank you for your time!

enter image description here