Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2010
    Posts
    89
    Thanks
    3
    Thanked 0 Times in 0 Posts

    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

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,028
    Thanks
    75
    Thanked 4,325 Times in 4,291 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •