I am working on a php project that needs to store information about various buildings and will store different types of information depending on the type of the building:
Class Building {
var $location
var $name
}
The Building class will be extended by classes like, House and Office so the classes will look like this (just an example)
Class House Extends Building {
var $numRooms;
var $numBathrooms;
}
Class Office extends Building {
var $offices;
var $sqfoot;
}
The question is, how should this be represented in a database (im using MySQL, if it matters). Should I use the building table to store the location and name and then create a table for each of the other classes to hold 'extended' variables? Or do I create a table for each class? or should the building table have columns for all the variables that can be in the other classes?