Re: Database naming convention (yet another post of it, but a bit different)

From: Marshall Spight <mspight_at_dnai.com>
Date: Wed, 09 Oct 2002 10:41:36 GMT
Message-ID: <AJTo9.92754$DN4.13763_at_sccrnsc01>


"Petruza" <autotacle_at_uol.com.ar> wrote in message news:3e55b51a.0210081559.4ac4c1f9_at_posting.google.com...

>

> 1) tables names are in singular, not to get confused with adding or
> not an ending "S", and because you are refering to a kind of class
> from which you would handle single instances.

I prefer the plural; the table represents all the employees.

> 2) tables and field names are all lower-case, I just prefer it for
> simplicity, and some engines or utilities may convert cases of table
> and field names.
> 4) Use underscore to replace spaces. like_this

You should group these two together.

You could also consider dashes instead of underscore. I don't get too worked up about case.

> 3) When using a foreign key, I use as the field name, the same name of
> the table that the foreign key is pointing to. Example:

There's some value to having each table's primary key column name have the table name in it. It makes natural joins easier, and is useful for documentation purposes w/ foreign keys.

> 5) Do not abreviate! it's not at all expensive to write some letters
> more, and it's more descriptive and readable. Copy & Paste will
> allways save you the effort. example: use Mortgage_index rather than
> mrtg_idx, using id for identification or identificator is ok, though.

Agreed.

> 6) Do not try tu use prefixes refering to data types, or identifying
> fields, tables,

Agreed.

> 7) Do not repeat the table name in a field's name ...

Agreed, with the possible exception of the primary key.

Marshall Received on Wed Oct 09 2002 - 12:41:36 CEST

Original text of this message