| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

07-04-09, 17:46
|
|
Registered User
|
|
Join Date: Sep 2002
Posts: 17
|
|
|
Naming Convention
|
|
Can someone help on naming conventions.
What do you guys/gals do for naming databases, tables, queries, etc?
Thx
|
|

07-06-09, 12:39
|
|
World Class Flame Warrior
|
|
Join Date: Jun 2003
Location: Ohio
Posts: 11,556
|
|
I name them what they are.
No prefixes, please....
__________________
If it's not practically useful, then it's practically useless.
blindman
www.chess.com: "sqlblindman"
|
|

07-06-09, 13:07
|
|
Registered User
|
|
Join Date: Sep 2002
Posts: 17
|
|
|
|
Ok gr8, no prefixes.
How about capitalization?
|
|

07-06-09, 13:12
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,085
|
|
Quote:
|
Originally Posted by oozypal
How about capitalization?
|
bad idea -- name everything in lower case
|
|

07-06-09, 14:02
|
|
Jaded Developer
|
|
Join Date: Nov 2004
Location: out on a limb
Posts: 8,768
|
|
captalisation can cause problems especially if you are working in a mixed Microsoft/Linux environment, some advocate not to use capitals but to capitalise the SQL eg SELECT my, column, list FROM mytable
theres numerous naming conventions out there. some peopel try to apply the Simonyi style notation (eg strThis, intThat and so on).. I'd argue there is no requirement to do so within the tables, within your application code its probably a good idea especiallyif you are using
Personally I prefer capitalising eg MyVariable, rather than myvariable.. for me its easier on the eye, easier to read. some advocate underscore eg tel_no, which I just think is ugly
however the one thing you can say on naming conventions is be consistent. if there is already a naming convention use it.
another thing to bear in mind as part of your convention is common abbreviations and perhaps just as importantly give column & table names a consistent name
eg TelNo in place of TelephoneNumber.. so NUmber should always be abbreviated in the same manner
Address is Addr and so on
some give the table name a plural eg you'd have a table products, rather than product
but be aware of any reserved words such as Desc, Name, Integer Date and so on.
style generic columns as say ID (for numbers), Type for text/char, dont include the table name eg in a table called products don't have a column called ProductID, have one called ID. if you prefer use ProductID where that value is acting as a FK to the ID in Products
But ultimately pick one that exists or develop one that meets your style and your requirememnt
frankly I suspect some of the naming conventions are more to do with individuals ego at seeing their name associated with a specific naming convention. it doesn't matter what you use, the real advantage of using a convention is that its easier to pick up your own work at a later date, or pick up someoone else's work.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
|
|

07-06-09, 15:19
|
|
www.gvee.co.uk
|
|
Join Date: Jan 2007
Location: UK
Posts: 10,002
|
|
Quote:
|
Originally Posted by r937
name everything in lower case
|
++1 .
|
|

07-06-09, 15:49
|
|
World Class Flame Warrior
|
|
Join Date: Jun 2003
Location: Ohio
Posts: 11,556
|
|
Quote:
|
Originally Posted by r937
bad idea -- name everything in lower case
|
Seriously? I use CamelCase for readability.
CamelCase - Wikipedia, the free encyclopedia
But the, you're just going to alias the crap out of everything anyway, so what do you care what its real name is? 
__________________
If it's not practically useful, then it's practically useless.
blindman
www.chess.com: "sqlblindman"
|
|

07-06-09, 15:53
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,085
|
|
Quote:
|
Originally Posted by blindman
Seriously?
|
yes, seriously
i'm guessing you've never used a non-microsoft operating system?
i mean, camel case is fine, don't misunderstand, i like it, but it's nothing to build a convention on, much less "best practice"
and aren't you the guy who disdains aliases?

|
|

07-06-09, 17:37
|
|
Registered User
|
|
Join Date: Dec 2007
Location: London, UK
Posts: 732
|
|
If you use mixed case then use tools that let you develop and test in a case-sensitive manner.
This is possible in Microsoft environments too. Even SQL Server 2008 has intellisense with auto-completion. In SQL Server you can make names case-sensitive and in C# they are by default.
|
|

07-07-09, 11:47
|
|
World Class Flame Warrior
|
|
Join Date: Jun 2003
Location: Ohio
Posts: 11,556
|
|
I prefer case insensitive. The CamelCase is for my benefit, not the server's or the application's.
__________________
If it's not practically useful, then it's practically useless.
blindman
www.chess.com: "sqlblindman"
|
|

07-07-09, 15:20
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,085
|
|
Quote:
|
Originally Posted by blindman
The CamelCase is for my benefit, not the server's or the application's.
|
pffffffffft!!! you're just the DBA, wtf do you know
ask your developers what they prefer
you might be surprised

|
|

07-07-09, 16:11
|
|
World Class Flame Warrior
|
|
Join Date: Jun 2003
Location: Ohio
Posts: 11,556
|
|
Quote:
|
Originally Posted by r937
pffffffffft!!! you're just the DBA, wtf do you know
ask your developers what they prefer
you might be surprised

|
I'm sorry. Are you referring to the bootlickingtoadies, or the BootLickingToadies?
__________________
If it's not practically useful, then it's practically useless.
blindman
www.chess.com: "sqlblindman"
|
|

07-07-09, 16:12
|
|
World Class Flame Warrior
|
|
Join Date: Jun 2003
Location: Ohio
Posts: 11,556
|
|
OK, I just asked all my developers, and they prefer CamelCase, saying that all lower case is difficult to read.
__________________
If it's not practically useful, then it's practically useless.
blindman
www.chess.com: "sqlblindman"
|
|

07-08-09, 10:22
|
|
www.gvee.co.uk
|
|
Join Date: Jan 2007
Location: UK
Posts: 10,002
|
|
lower_case_separated_by_underscores

|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|