MySQL Database Structure Question
This is probably going to seem a little odd, but I need some outside opinions. I'm using Dreamweaver CS5 to build a business website. When all is said and done, it's going to have around 20,000 items (not anytime soon, but it'll get there). I'm using a dynamic data set up to load the inventory because I'm way too lazy to build that many pages and links one at a time.
The corporate chain has two sections, lighting, and electrical supply. I want the database to hold the product ID(of course), name, description, image(this is part of where the question comes in), price, sale price(discounts not our cost), an enum field for whether or not the item is discontinued(for our own records), size / weight for shipping reasons, and if reality is permitting, a field for color selection of the products.
My original idea was to have two tables, one for lighting, one for electrical. Somebody pointed out to me that this could fail because they pointed out that some of the items might have multiple images, which is true. Some of the items (like some of the fans we sell) have different colors but still cost the same. They suggested I set the images up in a seperate table and use a foreign key. but that changes my entire structure.
Does anyone mind offering ideas on how I might set that up to avoid data redundancy and other problems that might pop up due to repeat listings? I've got the images all with unique names (in the case of the same product in different colors, I added a color code like pb for polished brass, etc.) That person had an excellent point on multiple tables, so now I'm wondering about a better and more reliable structure.
