I'm trying to built a database for ecommerce and I'm stuck with this problem.
I'll use a grocery store for the example.
First here's the tables.
table product_prd
id_prd
name_prd
description_prd
A product may have different "sizes" like a bag of chips. The table product_prd is linked (one-to-many) to product_size_pds
table product_size_pds
id_pds
idprd_pds //Foreign Key - product_prd.id_prd
name_pds //this contains the name of the size (ex. small,medium, large)
price_pds
weight_pds
lenght_pds
height_pds
I thinks there's a problem with my structure if the product as only one size like a camping chair.
I just can't leave the name_pds field empty or repeat the name from name_prd. It seems bad practice.
Is there a structure that could hold single size product and multiple size products?
Hope this makes sense.
Thanks