title: Database Naming Conventions
body: <p>This debate has been done to death here, and I particularly enjoyed reading <a href="https://stackoverflow.com/questions/238267/what-is-your-naming-convention-for-stored-procedures">this thread</a>.  However, I just wanted to ask one particular question and that thread is now closed, so here it is.</p>
  
  <p>I'm wondering what people's opinions are on column names.  The broad consensus seems to be to name the table's primary key in the format ID, e.g. CustomerID.  That's what I do.</p>
  
  <p>But what about the other columns?  I tend to prefix every column name with the table name, e.g. CustomerFirstName, CustomerDOB, etc.  That feels comfortable to me, but seems uncommon.  Leaving off the table name bothers me for two reasons.  Firstly, I worry that, as the database gets very big, there will likely be columns in different tables with the same name and it might get difficult to differentiate them, especially when debugging, and secondly it bothers my OCD to have the first column (the primary key, usually) begin with the table name but the others not.</p>
  
  <p>Are there any norms or principles that can help in choosing best naming rules?  One other thing, though.  In my convention of prefixing every column name with the table name there arises a problem - foreign key columns.  It makes no sense to have a column called CustomerStoreID to hold the StoreID foreign key, so I just call it StoreID.  But then that's breaking the convention, so is that proof that the convention was poor in the first place?  How do you name your foreign key columns?</p>