I am working on a php project that is supposed to store information about different buildings and store different types of information depending on the type of building:
Class Building {
var $location
var $name
}
The Building class will be extended by classes such as 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 this should be represented in the database (im using MySQL if that matters). Should I use a building table to store the location and name, and then create a table for each of the other classes to store the "advanced" variables? Or am I creating a table for each class? or should the build table have columns for all variables that might be in other classes?