[thelist] Database schema

David Siedband david at calteg.org
Tue Dec 9 19:30:50 CST 2003


I would have the products table contain only the fields that are common 
to all product types.

Then I'd have tables like ProdCPU, ProdMonitor, ProdOpticalDrives, 
ProdHardDrive

to store the fields that are unique to particular product types and use 
joins to acquire these fields when you display items of that category.  
Each of these tables that extends the products table would have a 
foreign key with the unique ID of the item in the products table to 
join them to.

--
Dave





On Dec 9, 2003, at 12:21 PM, Tab Alleman wrote:

> Cosmin G wrote:
>> Hi. I've been asked to develop a database for a computer website.
>> Right now I have the following tables:
>> categories (1 - cpu's, 2 - hard-drives, )
>> producer
>> product
>> exchange rate
>> All products have some common values (price, warranty period,
>> description) and there are some fields which are product specific
>> (such as cpu frequency, cpu cache memory, etc). Right now I've stored
>> all the product specific fields in the products table and prefixed
>> them with the name of the category they refer to. Is this a good
>> approach or should I put them in separate tables? The table is
>> getting pretty unmanageable already.
>
> I favor splitting category-specific columns into separate tables.
> -- 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list