Welcome Guest, Not a member yet? Register   Sign In
MySQL Table design
#2

[eluser]jedd[/eluser]
My feeling is that, especially if you have a known number of categories, that you do one category per table, all in one db of course.

Quote:Now each of these categories also posses sub categories. For example, used cars have different makes such as Honda, GM, etc. Wheels are divided into its sizes, etc.

I'd say that manufacturer is just another attribute. Similar, size is an attribute of wheel.

Quote:However, each of the categories (used cars, wheels, auto parts, etc) have different attributes. For example, used cars will have kilometers driven, price, transmission, etc.

An attribute table will list every type of attribute possible.

An attribute_item table will correlate the items with an attribute. There'd probably be a column for value in there.

Doing sanity checking on this (mileage can't be < 0, wheels can't have a transmission type, etc) will present some challenges, but they'd exist no matter what your schema.


Messages In This Thread
MySQL Table design - by El Forum - 03-30-2009, 04:24 PM
MySQL Table design - by El Forum - 03-30-2009, 04:41 PM
MySQL Table design - by El Forum - 03-30-2009, 05:05 PM
MySQL Table design - by El Forum - 03-30-2009, 07:16 PM
MySQL Table design - by El Forum - 03-30-2009, 07:32 PM
MySQL Table design - by El Forum - 03-30-2009, 07:34 PM
MySQL Table design - by El Forum - 03-30-2009, 08:35 PM
MySQL Table design - by El Forum - 03-31-2009, 05:24 AM
MySQL Table design - by El Forum - 03-31-2009, 07:53 AM
MySQL Table design - by El Forum - 03-31-2009, 08:04 AM
MySQL Table design - by El Forum - 03-31-2009, 11:59 AM
MySQL Table design - by El Forum - 03-31-2009, 10:01 PM
MySQL Table design - by El Forum - 03-31-2009, 10:04 PM
MySQL Table design - by El Forum - 03-31-2009, 10:34 PM
MySQL Table design - by El Forum - 04-01-2009, 07:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB