Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-02-2011, 12:26 PM   PM User | #1
flexillu
New Coder

 
Join Date: Aug 2010
Posts: 89
Thanks: 3
Thanked 0 Times in 0 Posts
flexillu is an unknown quantity at this point
Storing properties of a clothing item

I am storing details for clothing items.

Currently each item has a gender, category, type and variation.

E.g item001, male, 4, 6, 3

4, 6 , 3 is a reference to the cats, types and variations table(s).

So 4 is Trousers, 6 is jeans, 3 is slim fit.

However now I want to store much more detail about each item.

So should i use the existing structure and add columns like variation 1, 2, 3 etc or just have one table with all the possible properties and have a itemHasProperties table with item id and property id

Thanks
flexillu is offline   Reply With Quote
Old 08-02-2011, 07:56 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,245
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
I don't think anybody but you can know the right answer.

But as a general rule, if *most* variations can be attached to multiple *OTHER* variations, then you'd want them in a separate table.

In other words, colors and sizes are clearly independent: each should be a table.

But maybe colors and patterns are closely related; you have red stripes and red checks but never have blue checks. So maybe that means you have a COLORS_AND_PATTERNS table as a single table.

Kind of too general a question for us to answer without seeing the range of variations you are talking about.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:29 PM.


Advertisement
Log in to turn off these ads.