Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Naming Convention...

Status
Not open for further replies.

Programmer76

Programmer
Jul 25, 2006
35
CA
Hi,

Anyone have any suggestion for a good naming convention to use when naming table and columns?

I was taught LikeThis. Any opinions?

CES
 
Appears as though the best I can see that lowercase is the way to go...

my_table

my_id

etc...

 
As far as tables, I don't really use a specific set of rules. However, for the fields, I usually use the tablename then an underscore, then the field name.

Table = users
Field1= users_id
Field2= users_username
Field3= users_last_name
etc.

It just helps me keep things straight when looking at a complicated sql statement.

Mark
 
Personally I use uppercase for table names and lowercase for column names, which certainy helps weh looking at some queries:

SELECT TABLE.field,OTHERTABLE.field2 etc ....

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
mark, the "complicated sql statement" that you refer to could only be one which involves a join, in which case you can qualify the columns with their actual table names

otherwise, i find putting the table name as part of the column name is redundant, as well as simply decreasing the signal-to-noise factor and making it harder to read the query

r937.com | rudy.ca
 
Hi

I just hate the uppercases since early FoxPro times.

I write the identifiers with all words concatenated, and only some qualifiers separated by the underscore ( _ ) character :

operation
operationdetail
operation_old
operationdetail_old

And since I worked on an undesigned database with some identifiers in singular and others in plural without any logic, I avoid plural names.

Feherke.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top