Hello,
I need to make the databse structure for a real estate website where users can create properties of many types and with many features related to the property.
The main categories will be: 1. House (subtype apartment, house, loft) 2. Commercial (subtype: hotels, buildings, offices, factory) 3. Terrains (subtype: urban, agricola, industrial, for sports)
All this above can have many features defined, for example an apartment: light, gas, # of rooms, bathrooms, floor number, balcony, and so on, and this features are diferent from one property type to another.
At the moment I have one master table named property
containing the basic info like address and price, and three subtables property_house
, property_commercial
, and property_terrain
with as many fields as features a property can have.
Is this structure okay? I need to do the creation and modification of all the property types into one form maybe with 3-4 steps and will differ from one property type to another. Will it be easier if I have just one master table like property
and a second property_features
where to store the property_id, feature_name, and feature_value? What's best for performance and maintaining? What would you people vote for?
Thank you! :)