Mysql Naming Convention
hobby at redfiveconsulting.com
Tue Apr 18 16:21:35 MDT 2006
Plural is the right way. SQL was designed to be a natural language (thus
the select col from tablename where...)
Thus, a class represents a row in a table...a single row, whereas the table
represents a collection of rows (plural). Therefore, the table name is
plural, the class name is singular.
If you are using a framework, it should have a small function to convert
from plural to singular. You'll have to anyway, since at some point, you'll
need to have a plural word somewhere (i.e. "List of Clients" for the title
of a page, that queries the clients table).
MySQL even has built in functions that are plural:
From: kirk [mailto:kirk at emstraffic.com]
Sent: Tuesday, April 18, 2006 4:17 PM
To: mark at emstraffic.com
Subject: Fw: Mysql Naming Convention
----- Original Message -----
From: "Louis Zirkel" <lzirkel at cendev.com>
To: "Provo Linux Users Group Mailing List" <plug at plug.org>
Sent: Tuesday, April 18, 2006 4:12 PM
Subject: Re: Mysql Naming Convention
Gregory Hill wrote:
> But, there is no rule or standard in this regard.
Someone else said it as well but I personally think that since there is
no true standard that consistency is the most important thing. I think
the best thing would be to have a set of "engineering standards" for
naming conventions, be it in source code or sql code, or anything along
those lines for that matter.
Louis Zirkel / lzirkel at cendev.com
PLUG: http://plug.org, #utah on irc.freenode.net
Don't fear the penguin.
More information about the PLUG