Reputation: 52952
I have a table called Product and a table called Shop. Each shop has a list of Products that it sells. I need an intermediate table that has ShopID and ProductID in it. What should I call that table? My mind has drawn a blank.
ShopProducts?
Edit: Perhaps I should call it "ShopAvailableProducts"? Or is that too confusing.
Upvotes: 5
Views: 1458
Reputation: 298
I have seen product_shop_rel
used by ORMs. Like in OERP (now known as Odoo) for example.
Upvotes: 0
Reputation: 206
Shop2Product (or Product2Shop) is better: "2" in mid shows that this is intermediary table.
Upvotes: -1
Reputation: 65556
Personally I would just use ShopProduct as it makes sense in my language a product for/from/asociated-with a shop.
Upvotes: 0
Reputation: 115857
I prefer something along the lines of ShopProductsJunction
. This article might give a few other naming hints:
...also known as a cross-reference table, bridge table, join table, map table, intersection table, linking table, or link table
Upvotes: 2
Reputation: 9061
Yes ShopProduct (depending on the plurals you use) would be how I'd name a link entity.
Shop
|
-----
| | |
ShopProduct
| | |
-----
|
Product
So a shop can have many products and each product can be sold in many shops
Upvotes: 9