I have three tables:
Campus
Building
Floor
and table structure is looks like this:
CampusId
CampusDesc
BuildingId
BuildingDesc
FloorId
FloorDesc
I need help in optimizing the table relationship. If the user selects Campus then related building should be reference and floor:
Campus=>Building=>Floor
Do I need a another table for this relationship? Do I need to combine all three?
You will need to add CampusId to the table Building as well as BuildingID to the table Floor, that’ll establish the links.
In addition, I’ld created indexes on those added fields to speed up future searches.
I would assume that you already have unique indexes on CampusID, BuildingID and FloorID.