Updated Tony's Table and Field Naming Conventions

Upon some mild prodding and questioning by a fellow MVP I realized I was missing some of the reasons why I do things.  So I've did some editing and added text to Tony's Table and Field Naming Conventions

Published Tuesday, August 28, 2007 9:39 PM by Tony

Comments

# re: Updated Tony's Table and Field Naming Conventions

Hi Tony,

Thanks for expanding your explanations.  I really enjoy reading your perspective -- although we do not agree on some issues ... guess when it comes to naming, there are so many different scenarios and each feels theirs is best (like me ... and you <smile>)

One of your points that I highly DO agree with is not using "tbl" before all tablenames -- to me this just doesn't make sense! ... and certainly doesn't add any value that I can take advantage of (I do normally preface queries with "q" so a query name is never the same as a tablename -- now or future).  If the table prefaces have meaning -- such to identify what group of tables each belongs to such as Financial, Jobs, Quotes and Orders, Contact Information, then it does make sense to use it.  Convention for the sake of convention, to me, is silly.

"Because it can be somewhat time consuming and irritating to determine just what table a given field comes from."

I disagree.  For the most part, I really don't care what table a key value came from ... I am usually not reporting the ones without values <smile> -- and in the rare instance when it is important to differentiate, like filling in missing data, I will give a fieldname an alias.  Personally, I find it best to keep fieldnames consistent when they represent the same information.

"I also do not like using duplicate field names in different tables.   When these fields are on the same form or report and you are in design view all you can see is a portion of the table name."

In all database applications, I develop short, unique Table Aliases that are consistently used in SQL (and, therefore, queries), so this is not a problem. These Aliases are (1) tracked in a table, (2) appended to table descriptions, and (3) labeled on relationship diagrams.

"Occasionally I come across a situation where the table initials are identical.   Say Customer and Carriers."

In these cases, the more important table, Customers, would have an Alias of "C" and other tables such as "Carriers" would be given an alias, for instance, of "Car".  Because these aliases are thought of as soon as a table is created and compared against all other aliases being used, each is unique.

"I should note that I came up with these conventions when working on a database with 160 tables in the back end."

While I have adopted lots of personal conventions over the years, I am now in a situation where I am consolidating 1200 tables from 4 back-ends so I have been reading what others have to say before I simply do as I have always done ... and some of what you have pointed out has influenced me, thank you.

Warm Regards,

Crystal

*

    (:  have an awesome day  :)

*

Wednesday, August 29, 2007 3:52 AM by Crystal

Leave a Comment

(required) 
(required) 
(optional)
(required)