title: How to model attribute units in a database design?
body: <p>I need to design a database table where most attributes have units. For example:</p>
  
  <pre><code>Readings
  --------
  
  id   load (kW)   fuel_consumption (tonnes) - etc
  1    1154        89.4
  2    1199        54.2
  </code></pre>
  
  <p>What's the recommended way to capture the units in the design? For example, I could:</p>
  
  <ul>
  <li><strong>store units within attribute names</strong> e.g. load_kW and fuel_consumption_tonnes</li>
  <li><strong>store units in a separate table</strong> e.g. each value becomes a foreign key to another table with columns for value and unit. </li>
  <li><strong>store outside the database:</strong> e.g. in business logic, or in documentation</li>
  <li><strong>are there others?</strong></li>
  </ul>
  
  <p>I happen to be using MySQL, but I assume this is a generic database normalisation problem. </p>