Page 1 of 1

Autotrader similar website

Posted: Fri Feb 27, 2009 6:45 pm
by vchris
I want to create a website kind of like the auotrader.com website.

Here is the database design I came up with. Let me know what you think.

Trader DB

Makes Table:
make_id
make_name
make_type
make_date_created
make_date_modified
make_date_deleted
make_deleted

Models Table:
model_id
model_name
model_detail
model_date_created
model_date_modified
model_date_deleted
model_deleted

Vehicles Table:
vehi_id
vehi_year
vehi_mileage
vehi_colour
vehi_price
vehi_desc
vehi_date_created
vehi_date_modified
vehi_date_deleted
vehi_deleted

Ads Table:
ad_id
ad_desc
ad_phone
ad_email
ad_date_created
ad_date_modified
ad_date_deleted
ad_deleted

Regions Table:
reg_id
reg_name


make_x_model_x_vehi_x_ad Table:
mxmxvxa_id
mxmxvxa_make_id
mxmxvxa_model_id
mxmxvxa_vehi_id
mxmxvxa_ad_id
mxmxvxa_reg_id
mxmxvxa_deleted



Users Table (only admin for now):
user_id
user_name
user_pw
user_email
user_level
user_date_created
User_date_deleted
user_deleted

Re: Autotrader similar website

Posted: Thu Mar 19, 2009 2:46 am
by jaoudestudios
You might want a roles table for ACL? Store the postcode of the vehicle too and have a Postcode table with long/lat so your users can do a distance search, i.e. CV4 7AL within 30miles etc.

I would not prepend your IDs (primary keys) with the table name, there is no need. It actually makes it more confusing. Just use ID. You might think, but how do i know which one is which, well think of objects.
i.e.
make.id
user.id
...etc...

I have been planning a similar site too, may we can link to each other at the beginning to get a better rank in google? Just a thought.

Re: Autotrader similar website

Posted: Thu Mar 19, 2009 3:36 am
by papa
make_deleted is not necessary. If the delete_date field is filled it means that record is deleted. Unless you want to store some other information regarding the deletion.