Friday, August 19, 2011

Database design question

Hey,

I've got a question concerning my database design. I would like to
rewrite my website for small ads.

There are two possible ways of creating my database:

1) Put all in one big table

simplified example:

id (1)
name (2)
address (3)
zip (4)
city (5)
request_type (6)
description (7)
size (8)
location (9)
style (10)
instrument (11)
user_id (12)


For some small ads i need fields 1,2,3,4,5,6,7,10,11
for another ones i need fields 1,2,3,4,5,6,7,8,9,12

Each row would be saved in one table with some fields empty.


2) Different model/tabel for each category

instruments
id
name
address
zip
city
request_type
description
style
instrument

common
id
name
address
zip
city
request_type
description
size
location
user_id


I think I need about 6 or 7 categories...

The big question:
Should I create a extra model and database table for each small ad
category (version 2), or should I pack all categories in one table
(version 1)?


Regards,
Cronet

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate