0

I have done a lot of reading on naming columns for use in a data mart / data warehouse, as well as for general programming usage.

For example, if I had a business branch in a normal application I would have

Table BRANCH
------------
ID
Code
Name
RegionID

Now in the star schema data mart, I want to flatten the region information into this table. Which would be more appropriate and user friendly as a naming choice?

Table Branch_Dim
------------
BranchID
BranchCode
BranchName
RegionName
RegionShortName

OR

Table Branch_Dim
------------
ID
Code
Name
RegionName
RegionShortName
3

I just completed a 4 day course with the Kimball group and they had this to say on naming conventions:

  • Always use full descriptive names ie. Brand Name. and don't use abbreviations. Otherwise you may need to spend time training users.
  • Don't use Dim or Fact in your table names because you end up spending a lot of time deleting these from the reporting layer.
  • Don't use camel case or underscores, use spaces. Yeah I thought this was bizarre, but again they said you'll spend a lot of time adding in space at the reporting layer and most databases now handle spaces in column names without a problem.

If you subscribe to the Kimball methodology, then this is their approach. But like the other commenter said, it's all about comprehension. So if it makes sense for the business users, then you're on the right track.

0

Based purely on the fact that "Name" is a reserved word in some RDBMS (although, not SQL Server 2008), I was always taught to avoid it like the plague.

Apart from that, naming conventions are used to boost comprehension and should therefore always be consistent.

You've got two names in your branch table, one of which is prefixed with which type of name it is ("RegionName") because you were forced to do so upon merging those tables. I think if you're prefixing one then you should prefix them ALL, consistency is more important than naming conventions themselves.

You could prefix every string in a software system with "wibble", it's a bit weird but at least another programmer would very quickly identify that "wibble" means it's a string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.