title: "Special case" records for foreign key constraints
body: <p>Let's say I have a mysql table, called <code>foo</code> with a foreign key <code>option_id</code> constrained to the <code>option</code> table.  When I create a <code>foo</code> record, the user may or may not have selected an option, and 'no option' is a viable selection.  What is the best way to differentiate between 'null' (i.e. the user hasn't made a selection yet) and 'no option' (i.e. the user selected 'no option')?</p>
  
  <p>Right now, my plan is to insert a special record into the <code>option</code> table.  Let's say that winds up with an id of 227 (this table already has a number of records at this point, so '1' isn't available).  I have no need to access this record at a database level, and it would act as nothing more than a placeholder that the foreign key in the <code>foo</code> table can reference.</p>
  
  <p>So do I just hard-code '227' in my codebase when I'm creating 'foo' records where the user has selected 'no option'?  The hard-coded id seems sloppy, and leaves room for error as the code is maintained down the road, but I'm not really sure of another approach.</p>