title: Polymorphism in SQL database tables?
body: <p>I currently have multiple tables in my database which consist of the same 'basic fields' like:</p>
  
  <pre><code>name character varying(100),
  description text,
  url character varying(255)</code></pre>
  
  <p>But I have multiple specializations of that basic table, which is for example that <code>tv_series</code> has the fields <code>season</code>, <code>episode</code>, <code>airing</code>, while the <code>movies</code> table has <code>release_date</code>, <code>budget</code> etc.</p>
  
  <p>Now at first this is not a problem, but I want to create a second table, called <code>linkgroups</code> with a Foreign Key to these specialized tables. That means I would somehow have to normalize it within itself.</p>
  
  <p>One way of solving this I have heard of is to normalize it with a <code>key-value</code>-pair-table, but I do not like that idea since it is kind of a 'database-within-a-database' scheme, I do not have a way to require certain keys/fields nor require a special type, and it would be a huge pain to fetch and order the data later.</p>
  
  <p>So I am looking for a way now to 'share' a Primary Key between multiple tables or even better: a way to normalize it by having a general table and multiple specialized tables.</p>