Forum Moderators: phranque
Iam designing database that has categories for ex. like cars or mobiles.
so ive several categories like nokia, samsung, sony ericsson etc...
so there r lot of models in each category and every model have some info..
like nokia 9#*$! - size - weight - etc..
so my question is should i put every category (nokia, sony) in table
or all categories in one table?
Thanks in advance
CATEGORY
CategoryId
CategoryName
ParentCategoryId
ATTRIBUTE
AttributeId
AttributeName
ATTRIBUTEOPTION
AttributeOptionId
AttributeId
AttributeOptionName
PriceAmount
PricePercent
Weight
MANUFACTURER
ManufacturerId
ManufacturerName
ITEM
ItemId
ItemName
ManufacturerId
SKU
ManufacturerSKU
Weight
CATEGORYITEM
CategoryItemId
CategoryId
ItemId
ITEMATTRIBUTE
ItemAttributeId
ItemId
AttributetId
ITEMATTRIBUTEOPTION
ItemAttributeOptionId
ItemAttributeId
AttributeOptionId
So mobiles and cars would go into the Category table. Nokia, Ericsson, Samsung, and Sony would go into the Manufacturer table. Size goes into the Attribute table. Possible sizes go into the AttributeOption table. Sizes for a specific Item go into the ItemAttributeOption table. Weight goes into the Weight field of the Item table.
There are a hundred different ways to break down the smaller details. It all depends on what makes sense for your needs. If you have a lot of products and/or will be doing a lot of additions or updates, then you need to take time up front to get a good relational design. Otherwise the data maintenance will become extremely painful and expensive.
regards
Henry
maybe i wasnt clear in something...
my database will just have one thing of mobiles or cars..
so lets say just mobiles..
so should i make
Category
id
name
Model
id
name
size
weight
etc...
OR
Nokia
model_name
size
weight
etc...
Sony_ericsson
model_name
size
weight
etc...
Samsung
model_name
size
weight
etc...
so one big table or several smaller ones maybe 10 max 20.
Thanks again