Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005

    Unanswered: product table structure


    I have a question regarding structure of my products table. I am trying to develop a table for various t-shirts, sweatshirts, etc. I currently have productid, price, picture, category, description, etc. My question regards how to handle multiple colors. I don't really want to repeat all the data in the rows each time i have another color becuase that causes conflicts with the productid's and my sort options.
    I thought about a colorid linking to another table but i dont know if that would solve the problem or just over-complicate it.

    Does anyone have any suggestions?

    Jesse Foote

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    that's a good solution

    the relationship is many-to-many between product and colour, so you need a separate colour table, and then a relationship table to record the keys of product and colour which define which colours the products are available in

    over-complicated is when you try to do stuff like place a list of colour codes into a single column in the product table -- that's asking for a world of hurt

    i would personally stay away from ENUM datatype as well | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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