ON NAMING CONVENTIONS AND 1NF
with Hugh Darwen and Fabian Pascal

 

 

 

From: KD

To: Editor

Date: 27 Mar 2005

 

Some nits re On Temporal Data and the Relational Model.

 

Date remarks: "Naturally (?) I'd try to choose relvar names, attribute names, and so forth that make that explanation as intuitively obvious as possible. For example, I might use names as indicated in the following picture:" paraphrased here as VACATIONS (NAME, NO_OF_WEEKS).

 

As an aside, the use of the double quotes is required for mixed case column name usage in SQL databases such as Oracle's. As another aside, we can be mindful of 1NF regarding our naming of attributes and relvars.

 

I also weigh the choice of an attribute name in the context of the universal relation and both internal and external lexicons with respect to the client's organization. Regarding the universal relation, i.e. attempting to make your "NO_OF_WEEKS" stand alone, I would choose the name (title) "Vacation Allowance" and the relvar name "Vacation Allowances" having arrived at allowance upon looking up allotment in a thesaurus. Now, having lost the unit of measure, I reinsert it, thereby arriving at the attribute title “Vacation Allowance (w)”.

 

 

From: Hugh Darwen

To: KD

 

I think the remark about SQL is incorrect. SQL is case-insensitive with respect to identifiers.  Double quotes are needed only when certain characters (e.g., spaces) are included or the first character is not a letter.

 

I fully agree with the use of the singular for attribute names, but I disagree with the use of the plural for relvar names.

 

I do not understand the reference to 1NF at all. (And, as Date and I have written elsewhere, we don't know what Codd meant by 1NF anyway.)

 

 

From: Fabian Pascal

To: Hugh Darwen

 

Date’s position, as expressed in What First Normal Form Really Means, is that in every "cell" of a relational table there is only one value, not more.

 

The naming approach is not scientific, is it?

 

 

From: Hugh Darwen

To: Fabian Pascal

 

Oh, I see, but we don't use the term 1NF for that any more because it's implicit in the term "relation".  I thought Davis meant some distinction between relations in 1NF and relations that are not in 1NF.

 

No, choice of names is never a scientific position as far as I'm aware!  I tend to use singular verbs, such as WORKS_IN and IS_PAID for relvar names, but singular nouns like STUDENT and COURSE for ones that E-R people would regard as representing entity types as opposed to relationship types (and E-R people certainly do use the singular, precisely because they are dealing at the type level).

 

 

From: Fabian Pascal

To: Hugh Darwen

 

Well, when dealing with tables, there must be a criterion by which to determine whether a table faithfully represents a relation or not. As far as I know that criterion is:

 

1.      1NF—no multiple values in cells.

2.      Unique rows

3.      Immaterial ordering of rows and columns.

 

 

From: Hugh Darwen

To: Fabian Pascal

 

Well, I don't use the term "relational table", nor do I like to regard relations as a proper subset of tables.  Of course I agree with the notions expressed by your three criteria, but I wouldn't express the first one that way.  It isn't strong enough (it doesn't prohibit "empty cells") and I wouldn't use the term "1NF".  I say that each tuple of a relation has exactly one value for each attribute of that relation, the value being of (or having) the type that is the declared type of that attribute.

 

 

From: Fabian Pascal

To: Hugh Darwen

 

The point is that relations are mathematical abstractions  We only deal directly with pictures of relations—tables—not relations, and the question then is do they faithfully represent relations or not.

 

I see no reason why 1NF should not be a shorthand for "exactly one value", since it is being used anyway, and for the old notion of "atomic values"; so the new use is an opportunity to correct that notion.

Your other two points are well taken, but they could be added as implications of 1NF. Thus, a table is relational/faithfully represents a relation, iff:

1. Is in 1NF (has exactly one value in every cell)
    a. each value drawn from the proper domain
    b. no empty cells
2. Has at least one candidate key
3. The order of rows and columns is immaterial

 

 

Posted 5/20/2005