Database design question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
fried
Forum Newbie
Posts: 16
Joined: Tue Sep 08, 2009 5:43 am

Database design question

Post by fried »

I'm modifying an existing database for use with a t-shirt ecommerce shop. The database I started with has a very simple structure, Product_id, description, image, stock. I need to add attributes to the T-shirts ( I thought using the T-shirt style (short-sleeve/ long-sleeve/polo etc) was best as the products). I need shirt_colour, size, logo, logo_colour combinations for all products. Is this too much info for an attributes table? I want to get a balance between useabilty and complexity.

Any suggestions gratefully recieved.
urooj786
Forum Newbie
Posts: 12
Joined: Mon Nov 09, 2009 11:56 pm

Re: Database design question

Post by urooj786 »

u will have to design db according to the basic design db anamolies..like to which u give primary key
..etc, for t-shirt make tshrt_type feild and rest u will do easily
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Database design question

Post by califdon »

fried wrote:I'm modifying an existing database for use with a t-shirt ecommerce shop. The database I started with has a very simple structure, Product_id, description, image, stock. I need to add attributes to the T-shirts ( I thought using the T-shirt style (short-sleeve/ long-sleeve/polo etc) was best as the products). I need shirt_colour, size, logo, logo_colour combinations for all products. Is this too much info for an attributes table? I want to get a balance between useabilty and complexity.

Any suggestions gratefully recieved.
There are no limits on attributes (fields). The answer is always: Whatever it takes to adequately describe the entity. I've worked on databases with literally hundreds of attributes for a complex, technical entity. The important issues include the requirement that every attribute must depend on the primary key. So if your customer needs to select a shirt by colour, size, logo and logo colour, and in each case a particular stock of shirts can be described by these attributes, then you need to include them in the table.
Post Reply