title: Creating non-existent database tables in code
body: <p>Up to this point my company has had an aversion to databases and has stuck to storing all data in comma-separated files.  I have run into a unique customer application that - I believe - would benefit from the use of a relational database.  The application calls for storing 'summary' data concerning a manufacturing process and 'detailed' data on multiple sub-processes.  The sub processes need to be linked to the process summary.  </p>
  
  <p>My question: Is it normal/appropriate to check for the existence of a table prior to writing to this table, and creating it if the table does not exist?  This may lead to a larger question now that I'm typing this; if the database does not exist, should I be creating the database and any tables that it requires?</p>