Answer the question
In order to leave comments, you need to log in
How to organize a database with real estate?
Hello! Prompt as it is correct to organize a DB of the real estate. We have a building and we have a room.
For example, a skyscraper is a building, and apartments in it are premises.
A business center is a building, and the offices in it are rooms The
question is how to properly organize tables Because there can be many rooms in one building. It turns out 2 tables.
" Buildings " and " Premises ". The premises have a buildingID field .
Do I need to store multiple roomIDs in the Buildings table ?
Buildings have several properties. For example, number of storeys and year of construction. Everything is simple here. And what about the material of the walls. Brick there or panel (the list of options is strictly limited to avoid "brick", "brick", "BRICK"). Need a separate " Wall Material " table with a list of values? And in the " Buildings " table, you just need to write the materialWallID ?
And there are many similar ones.
Answer the question
In order to leave comments, you need to log in
Здания {
ID: (guid или int32) PK
МатериалСтен: byte (enum)
Этажность: byte
ГодПостройки: int16
}
Помещения {
ID: (guid или int32) PK
ЗданиеID: (guid или int32) FK
Номер: int16 (или строка если будут буквы ещё)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question