title: Different Types for the Same Column
body: <p>My database stores version numbers; however, they come in two formats: major.minor.build (e.g. 8.2.0, 12.0.1) and dates (e.g. YY-MM-DD). I had thought of two solutions:</p>
  
  <pre><code>+---+---+-----+-----------+ +-----+-----+-----+-----+ +-----+--------+
  |...|...|id   |versionType| |id   |major|minor|build| |id   |date    |
  |---+---+-----+-----------| |-----+-----+-----+-----| |-----+--------|
  |...|...|12345|0          | |12345|0    |1    |2    | |21432|12-04-05|
  |---+---+-----+-----------| +-----+-----+-----+-----+ +-----+--------+
  |...|...|21432|1          |
  +---+---+-----+-----------+
  </code></pre>
  
  <p>or</p>
  
  <pre><code>+---+---+-----+-----+-----+-----+--------+
  |...|...|id   |major|minor|build|date    |
  |---+---+-----+-----+-----+-----+--------|
  |...|...|12345|0    |1    |2    |null    |
  |---+---+-----+-----+-----+-----+--------+
  |...|...|21432|null |null |null |12-04-05|
  +---+---+-----+-----+-----+-----+--------+
  </code></pre>
  
  <p>Neither of these look particularly efficient: the first requires a join across two tables just to get a version number, while the second wastes twice as much space per version entry compared to the first. Alternatively, I could just store the value in some amount of bits in a column then interpret that on the client side, but I'm hoping that there's some standard practice for this situation that I've overlooked.</p>
  
  <p>Is there a proper way to store two different types of data for the same 'column' in a relational database?</p>