I'm new to rails and need some help with DB design.
It is basically category
, product
, quantity
, price...type of tables.
I have 4 categories: CatA CatB CatC CatD
Each category above will have multiple products in them:
CatA - ProductA1, ProductA2, ProductA3
CatB - ProductB1, ProductB2, ProductB3
CatC - ProductC1, ProductC2, ProductC3
CatD - ProductD1, ProductD2, ProductD3
Each Product then has a type, rating, quantity, price, volume
Would it be good to have one big Product table with columns: Category, Product Name, Type, Rating, etc..ec..
or have different tables for Category, Product, Type
which relationship will they have belongs_to or has_many
?
I'm looking at it from Admin Point of View. If a user wants to add a new product then they'll first select category from drop down, type product name, select product type etc. having everything in one table will be easy but is that efficient?