title: "Extend" relationship in a relational database
body: <p><strong>Hello,</strong><br />
  I'm currently trying to apply the most efficient way to store an "extend" relationship between entities in a relational database.</p>
  
  <p>For the sake of example, lets say we have the following simplified entities:</p>
  
  <ul>
  <li><code>User</code></li>
  <li><code>Student</code> (extends <code>User</code>)</li>
  <li><code>Teacher</code> (extends <code>User</code>)</li>
  </ul>
  
  <p><code>User</code> contains attributes which apply to both <code>Student</code> and <code>Teacher</code>. Both <code>Student</code> and <code>Teacher</code> contain custom attributes which are unique to them.</p>
  
  <p>The first thing that comes to mind is to create a single table with columns for all singular data (i.e. except one-to-many fields):</p>
  
  <pre><code>User
  -------------
  User ID
  First name
  Last name
  Student class
  Teacher office no.
  Teacher description
  ...
  </code></pre>
  
  <p>This however won't be very efficient from a storage perspective, because:</p>
  
  <ul>
  <li>the majority of rows will contain students, with a small number of teachers</li>
  <li>teachers will have much more unique columns, which would waste space in students' rows</li>
  </ul>
  
  <p><br />
  It would be more efficient to replicate relationships between the entities:</p>
  
  <pre><code>User
  -------------
  User ID
  First name
  Last name
  ...
  
  
  Student
  -------------
  User ID
  Student class
  ...
  
  
  Teacher
  -------------
  User ID
  Teacher office no.
  Teacher description
  ...
  </code></pre>
  
  <p>So my questions are:</p>
  
  <ol>
  <li>Is the above concern taking it too far, i.e. should we leave storage efficiency to the database engine?</li>
  <li>Is splitting the entities into 3 tables still OK in terms of normalization?</li>
  <li>If it's not a good approach, how would you recommend to treat "extend" relationships in a relational database?</li>
  </ol>
  
  <p>Thank you.</p>