If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Robust Database for Real Estate Website

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-17-11, 21:16
shairoo shairoo is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
Cool Robust Database for Real Estate Website

I need to make a Real Estate Project, where user can post different listings for Sale or Rent their Real Estate Properties.
There are some Catagories for Properties with different Properties types.
for example
1. Resedential
home
portion
flat
apartment
2.Commercial
shop
office
floor
etc.

Now the problem is that every property type has some common attribute i.e price, Area, construction but also has some uncommon attributes like home doesn't contain parking attribute while a shop or office has.

Please if anybody can tell me how to structure this as a database.

Thanks,
With Regards,
Shairoo
Reply With Quote
  #2 (permalink)  
Old 03-18-11, 00:57
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,535
this is a classic supertype/subtype problem

you need a supertype table called properties, which will hold all the common columns

then you need two subtype tables called residentialprops and commercialprops with only the unique columns (and of course a Foreign Key which references the Primary Key of the supertype table)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 03-18-11, 01:17
shairoo shairoo is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
but there are also distint variables for every residential or commercial property type......
Reply With Quote
  #4 (permalink)  
Old 03-18-11, 18:55
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
No there isn't, unless you are working with some seriously bizarre MLS vendor.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
Reply

Tags
complex database, database help, database structure, db design problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On