I have two tables products
and product_tags
in my database having a many-to-many relationship. But I am having a hard time coming up with a practical name. So I was wondering if there is a standard for such a stuff?
For orders
and products
which also have many-to-many relationship, I can name the association table like order_items
. And it makes sense. There is also people who suggest using xref
at the end (like product_tags_xref
) but I found some people complaining that it can possibly conflict with autocad or something. Some people suggest repeating the name, but it doesn't seem like a great idea in this case, cos the "products"
name repeats. So it would be like products_product_tags
which looks ugly and long and also doesn't convey the idea. Also it might be really weird when I am coding in node and have to do something like db.ProductsProductTags
which is again ugly.
Right now I am going with product_tag_maps
but don't know if its the best naming convention.
I have found questions on this topic in SO and other places but none for this scenario where the name of tables contain same words and repeating the name would be bad.
Also I didn't know where to post the question on DBA
or SE
. I choose SE
because naming matters more when the name is referenced in the code multiple times and the coder might not always have direct reference to the model ER diagram to see whats going on.