I read similar question (Relational table naming convention), but unfortunately I couldn't find the answer for my problem.
I have products. Products can have images and comments. They are one-to-many relationships.
The table and entity names are the following:
- product (Product)
- product_comment (ProductComment)
- product_image (ProductImage)
Product is independent, comment and image depends on product. No problems so far.
But i need to classify products into categories (one-to-many).
Category can exist on its own, it's independent, so i can't use the product_category (ProductCategory) naming (it would express that products can have categories).
The naming without any prefix (category (Category)) is also not good, because there could be other categories in the database (categories for users etc.).
So it seems for me that the only solution is:
- category (Category)
- category_product (CategoryProduct)
- category_product_Comment (CategoryProductComment)
- category_product_Image (CategoryProductImage)
But I'm not happy with that either. It expresses that categories can have products...
Any help is highly appreciated!
Thank you!