Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Field naming conventions using SQL server or other main frame databases

Posted on 2007-07-19
3
Medium Priority
?
350 Views
Last Modified: 2008-02-01
What is the advantage (if any) of naming fields in a main frame database i.e. Sql Server, Oracle, etc. upper case vs. lower case or conventional case (MyField)? We have a rather arrogant young engineer trying to convince me it makes a difference. We currently use all upper case. He suggests conventional case. Does it really make a difference??
0
Comment
Question by:ACCESSIBLESOLUTIONS
3 Comments
 
LVL 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 600 total points
ID: 19527449
On SQL Server it makes no difference.  That said, I find all upper and all lower harder to read.
So, out of:

customeraddressid
CUSTOMERADDRESSID
CustomerAddressID

I would prefer the last, but that is just a personal preference :)
0
 
LVL 29

Accepted Solution

by:
Bill Bach earned 800 total points
ID: 19527587
I can tell you that Pervasive.SQL also ignores case.  I believe that the SQL language in general (at least for anyone following the ANSI standards) is case INSENSITIVE for all table names, field names, index names, etc.  

Personally, I also prefer mixed case, capitalizing each word, which makes it easier to read.  Sometimes, it DOES make a different, as a Product Maintenance Switch field, labelled PMSWITCH, can be read in two different ways depending on the day.  ;-)

The same can be said for the SQL keywords -- these are also case insensitive.  However, readability does start to come into play if you are flexible with whitespace, too.  It is one reason why I like to use all caps for SQL keywords, and mixed case for tables and columns.  This makes it easier to read queries in a hurry. (Do you ever have time to read them slowly?)

Imagine a strange query, pulling the "Select" field from the "From" table, which in all caps looks like:
    SELECT SELECT FROM FROM
or, with mixed case:
    SELECT Select FROM From
OK, so the names are a bit contrived, but in larger queries, I think you'll see a huge difference in readability.

So, in short, it does not matter which case you use to the computer -- but it might make a difference to the human trying to read it later on.
0
 
LVL 42

Assisted Solution

by:dqmq
dqmq earned 600 total points
ID: 19527645
Some databases are case-sensitive--even SQL server can be installed/configured that way.  And it's a real pain when you encounter one.  So, if you are working on a case-senstive DB, then it is very important to use an uppercase/lowercase/mixed case standard consistently.  If the database is not case sensitive, then its a matter of style and will not effect outcome of queries.  That said, a following a standard can add to readability and can help make code more self-documenting.  
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question