0

Hey everybody,

I'm new to mysql, but I'm developing a real estate website, mostly for condos. I'm setting up the database and want to make sure it's sufficiently designed so that customers can search the database for the type of place they want.

Specifically, if someone wants to search for the number of rooms in the condo. Some properties have a range of rooms, so they will have 1, 2, and 3 bedroom condos available, and I want them to be able to search for price related to those properties, and obviously the prices for each condo would be different based on the number of rooms, even if they're in the same property.

Would it be wise to setup the database so that each property has a different database entry for the number of rooms (i.e. one entry for condo company, 1 bedroom, $200,000 | one entry for condo company, 2 bedrooms, $300,000) OR should I do one entry for the property and separate columns for 1 bedroom, 1 bedroom price, 2 bedroom, 2 bedroom price, etc.?

Any help would be much appreciated.

Thanks!

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by mwasif
0

Not sure you mean by 'entry'. But your first choice seems about right.

You will want a table with the following fields:
ID
Company
# bedrooms
Price

Then a user could select from your db where company=x AND #bedrooms = y AND price <= z

Of course if you want to be able to search for more criteria you will have to incorporate them.

0

Not sure you mean by 'entry'. But your first choice seems about right.

You will want a table with the following fields:
ID
Company
# bedrooms
Price

Then a user could select from your db where company=x AND #bedrooms = y AND price <= z

Of course if you want to be able to search for more criteria you will have to incorporate them.

trudge is right.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.