database , table, field , query naming/coding conventions ??

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

database , table, field , query naming/coding conventions ??

Post by PHPycho »

i am eager to know the convention or standards used for naming database,table,fields.
Can anybody suggest here. i am always in dilemma in using for example
1> users or user , which table name is preferred
2>id or tableName_id , which should be preferred
etc etc.
Also it would be helpful to many if coding standards for sql query is also mentioned.
waiting for the results
hope for the best
Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I typically use <applicationName>_<descriptiveTableName> for table names. "users" versus "user" doesn't really matter to me.

As for field identifiers, the same basic principle is used: <tableName>_<descriptiveFieldName>.
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

Post by PHPycho »

I would appreciate your decision.....
is there anybody to share ideas, huh?
Mohamed
Forum Newbie
Posts: 21
Joined: Fri Jan 19, 2007 6:59 pm
Location: Seattle

Post by Mohamed »

feyd wrote:I typically use <applicationName>_<descriptiveTableName> for table names. "users" versus "user" doesn't really matter to me.

As for field identifiers, the same basic principle is used: <tableName>_<descriptiveFieldName>.
I am with feyd, I always use that conventions because you can easily query database without viewing it.
Post Reply