I have a Categories -> Products -> and Review Table. My question is whether it’d be optimal to create a reference from the Review Table and the Category it belongs to, or should I just use the Review -> Product relationship to get the Review -> Product -> Category? Thanks 🙂
Advertisement
Answer
If the review is applied to the product, then there is no point in referencing Categories table to Review table as far as database design is concerned.
There is no problem in accessing the project’s category through the review because that is how it should work. If the review is for a product, then it doesn’t apply to category, so no relation should be made