title: SQLAlchemy Inheritance
body: <p>I'm a bit confused about inheritance under sqlalchemy, to the point where I'm not even sure what type of inheritance (single table, joined table, concrete) I should be using here. I've got a base class with some information that's shared amongst the subclasses, and some data that are completely separate. Sometimes, I'll want data from all the classes, and sometimes only from the subclasses. Here's an example:</p>
  
  <pre><code>class Building:
      def __init__(self, x, y):
          self.x = x
          self.y = y
  
  class Commercial(Building):
      def __init__(self, x, y, business):
          Building.__init__(self, x, y)
          self.business = business
  
  class Residential(Building):
      def __init__(self, x, y, numResidents):
          Building.__init__(self, x, y, layer)
          self.numResidents = numResidents
  </code></pre>
  
  <p>How would I convert this to SQLAlchemy using declarative? How, then, would I query which buildings are within <code>x&gt;5</code> and <code>y&gt;3</code>? Or which Residential buildings have only 1 resident?</p>