how do i name my fields? i always prefix them with "fld" to be consistent with the standard of always prefixing my tables with "tbl"
i mean, otherwise, i wouldn't know they were fields, would i
JUST KIDDING!
prefixes are stupid
karl, i have real problems with your FAQ
Some writers prefer to use plural where it seems appropriate, but my quarrel with them is that it is very difficult for everyone to agree when it is appropriate. Consequently, it is better to leave no doubt and make them ...
...
plural, period.
-
Designate look-up tables with either a prefix or suffix that will always indicate the tables purpose, e.g. luTableName or TableNameLkU.
and what if some day it becomes a "real data" table instead of a "lookup" table? would you then have to rename it and change all occurrences in existing code? if you left the name as is, wouldn't that be confusing?
-
Designate many-to-many tables (conjoint table) by using an underscore between the associated table names, e.g. Product_Supplier.
please don't say this and also expect us to accept your advice later on in column names: "Avoid underscores, they look unnatural and slow the reader down."
-
Double shame on Microsoft for the use of ID which is very ambiguous and requires the use of a table qualifier or brackets.
in which microsoft database are square brackets required for a column named ID, please? and what exactly is wrong with table qualifiers?
-
TableNameID for integer (the preferred choice for all primary keys)....Do not change the spelling of a primary key from one table to the next.
conflicting advice, hmm? If i have two tables for employee data that use the same primary key, and it's called Table1ID in Table1, shouldn't it be called Table1ID in Table2 too?
-
later on this spring, Joe Celko's new book
SQL Programming Style will come out, which addresses all these concerns
watch for it, it will be quite interesting
rudy |
r937.com |
Ask the Expert |
Premium SQL Articles
SQL for Database-Driven Web Sites (next course starts March 6 2005)