title: Is there a naming convention for MySQL?
body: <p>Here's how I do it:</p>
  
  <ol>
  <li>Table names are lower case, uses underscores to separate words, and are singular (e.g. <code>foo</code>, <code>foo_bar</code>, etc.</li>
  <li>I generally (not always) have a auto increment PK. I use the following convention: <code>tablename_id</code> (e.g. <code>foo_id</code>, <code>foo_bar_id</code>, etc.).</li>
  <li>When a table contains a column that is a foreign key, I just copy the column name of that key from whatever table it came from. For example, say table <code>foo_bar</code> has the FK <code>foo_id</code> (where <code>foo_id</code> is the PK of <code>foo</code>).</li>
  <li>When defining FKs to enforce referential integrity, I use the following: <code>tablename_fk_columnname</code> (e.g. furthering example 3, it would be <code>foo_bar_foo_id</code>). Since this is a table name/column name combination, it is guaranteed to be unique within the database.</li>
  <li>I order the columns like this: PKs, FKs, then the rest of columns alphabetically</li>
  </ol>
  
  <p>Is there a better, more standard way to do this?</p>