title: SQL Design: representing a default value with overrides?
body: <p>I need a sparse table which contains a set of "override" values for
  another table.  I also need to specify the default value for the
  items overridden.</p>
  
  <p>For example, if the default value is 17, then foo,bar,baz will have
  the values 17,21,17:</p>
  
  <pre><code>table "things"   table "xvalue"
  name  stuff      name xval
  ----  -----      ---- ----
   foo  ...         bar   21
   bar  ...
   baz  ...
  </code></pre>
  
  <p>If I don't care about a FK from xvalue.name -> things.name, I could simply
  put a "DEFAULT" name:</p>
  
  <pre><code>                 table "xvalue"
                   name xval
                   ---- ----
                DEFAULT   17
                    bar   21
  </code></pre>
  
  <p>But I like having a FK.  I could have a separate default table, but it
  seems odd to have 2x the number of tables.</p>
  
  <pre><code>                 table "xvalue_default"
                        xval
                        ----
                          17
  
                   table "xvalue"
                   name xval
                   ---- ----
                    bar   21
  </code></pre>
  
  <p>I could have a "defaults table"</p>
  
  <pre><code>            tablename  attributename  defaultvalue
                 xvalue           xval            17
  </code></pre>
  
  <p>but then I run into type issues on defaultvalue.</p>
  
  <p>My operations guys prefer as compact a representation as possible,
  so they can most easily see the "diff" or deviations from the
  default.</p>
  
  <p>What's the best way to represent this, including the default value?  This will be for Oracle 10.2 if that makes a difference.</p>