title: How to implement a super class, sub class relationship in the database?
body: <p>If I have a class called animal, dog and fish is the subclass. 
  The animal have attribute called "color". 
  Dog have the attribute called "tail length", and the fish don't have this attribute. 
  Fish have the attribute called "weight", the dog don't have this attribute.</p>
  
  <p>So, I want to design a database to store this information. What should I do? Here is some ideas:</p>
  
  <p>Idea 1:
  Making an animal table, and the table have type, to find what kind of animal, if it is a dog, just get the result from dog table. </p>
  
  <p>Animal:
  color:String
  type:int</p>
  
  <p>Type:
  Dog:0
  Fish:1</p>
  
  <p>Dog:
  TailLength:int</p>
  
  <p>Fish:
  Weight:int</p>
  
  <p>Idea 2:
  Store only Dog table and Fish table in the database, remove the animal table. </p>
  
  <p>Dog:
  Color: String
  TailLength: int</p>
  
  <p>Fish:
  Color: String
  Weight: int</p>