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

[eluser]peterbz[/eluser]
Quote: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.

So are you saying something like this?

ATTRIBUTES
Code:
attr_id  |  attr
1           mileage
2           transmission
3           size

ATTRIBUTE ITEM
Code:
attr_id  |  listing_id  |  value
1           43             3000km
1           107            2911km
2           43             auto
2           107            auto
3           92             17 inch

But the downside of having an attribute table and putting all items into one single table is that each select statement will take very long since the ONE table will contain so many rows


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