Comments on: Choosing Data Types http://thoughts.davisjeff.com/2009/09/30/choosing-data-types/ Ideas on Databases, Logic, and Language by Jeff Davis Tue, 19 Jun 2012 16:18:51 +0000 hourly 1 http://wordpress.org/?v=3.3.1 By: Bill Karwin http://thoughts.davisjeff.com/2009/09/30/choosing-data-types/comment-page-1/#comment-105 Bill Karwin Sun, 18 Oct 2009 06:46:50 +0000 http://thoughts.davisjeff.com/?p=130#comment-105 Sorry, I may not have been clear. I do support using complex types. And I support the statement that a complex type (or even a semi-complex type like a string or a date) is *not* a violation of 1NF. A given string is an atomic value, because it passes the test that it can be equal to or not equal to another string in the same column. Even Date agrees in his book. He says that the relational model should permit even relation-valued columns. There's no reason not to. Sorry, I may not have been clear. I do support using complex types. And I support the statement that a complex type (or even a semi-complex type like a string or a date) is *not* a violation of 1NF. A given string is an atomic value, because it passes the test that it can be equal to or not equal to another string in the same column.

Even Date agrees in his book. He says that the relational model should permit even relation-valued columns. There’s no reason not to.

]]>
By: Jeff Davis http://thoughts.davisjeff.com/2009/09/30/choosing-data-types/comment-page-1/#comment-100 Jeff Davis Tue, 13 Oct 2009 04:23:46 +0000 http://thoughts.davisjeff.com/?p=130#comment-100 The problem is: where do you draw the line? Normal forms are *formally* defined, and so they cannot rely on any informal definitions. Conceptually, yes: you should be skeptical of designs that use extraordinarily complex types. But (a) that does not constitute a violation of 1NF; and (b) complex types are certainly useful for attributes in many situations. I prefer to have access to the full power of a good type system when working with an RDBMS. I'm not suggesting we go down the road of OODBMSs or anything of the sort, but I do think that we should have access to an adequate set of types to describe a business. The problem is: where do you draw the line? Normal forms are *formally* defined, and so they cannot rely on any informal definitions.

Conceptually, yes: you should be skeptical of designs that use extraordinarily complex types. But (a) that does not constitute a violation of 1NF; and (b) complex types are certainly useful for attributes in many situations.

I prefer to have access to the full power of a good type system when working with an RDBMS. I’m not suggesting we go down the road of OODBMSs or anything of the sort, but I do think that we should have access to an adequate set of types to describe a business.

]]>
By: Bill Karwin http://thoughts.davisjeff.com/2009/09/30/choosing-data-types/comment-page-1/#comment-99 Bill Karwin Wed, 07 Oct 2009 21:36:17 +0000 http://thoughts.davisjeff.com/?p=130#comment-99 I see what you're saying about strings and dates seeming to be non-atomic, but as I'm reading "SQL and Relational Theory" by C. J. Date I'm learning that they really are. Date says that a data type is a "named finite set of values" and that to be a type, the equality operation has to be defined. That is, you can compare any two values in the type and say they are equal or not. That seems like a pretty straightforward basic definition of a data type. A string or date can be decomposed or transformed, but I would say that such operations yield a different value, not a part of the original value. Just like an integer expression like x+2 yields a different value from x. I see what you’re saying about strings and dates seeming to be non-atomic, but as I’m reading “SQL and Relational Theory” by C. J. Date I’m learning that they really are.

Date says that a data type is a “named finite set of values” and that to be a type, the equality operation has to be defined. That is, you can compare any two values in the type and say they are equal or not. That seems like a pretty straightforward basic definition of a data type.

A string or date can be decomposed or transformed, but I would say that such operations yield a different value, not a part of the original value. Just like an integer expression like x+2 yields a different value from x.

]]>
By: Jeff Davis http://thoughts.davisjeff.com/2009/09/30/choosing-data-types/comment-page-1/#comment-98 Jeff Davis Fri, 02 Oct 2009 05:30:58 +0000 http://thoughts.davisjeff.com/?p=130#comment-98 I'm sure there are a lot of great stories about "notes" fields :) I wonder how common it is to enter some specific value in another field that is known to be wrong, and then explaining the real value in the note to CYA. That way, the reports all reflect the lie, but the person who entered it can claim that they entered it correctly. I’m sure there are a lot of great stories about “notes” fields :)

I wonder how common it is to enter some specific value in another field that is known to be wrong, and then explaining the real value in the note to CYA. That way, the reports all reflect the lie, but the person who entered it can claim that they entered it correctly.

]]>
By: Richard Broersma Jr. http://thoughts.davisjeff.com/2009/09/30/choosing-data-types/comment-page-1/#comment-97 Richard Broersma Jr. Thu, 01 Oct 2009 15:41:45 +0000 http://thoughts.davisjeff.com/?p=130#comment-97 If you have an attribute that holds “notes”, there’s not much you can do with a set of such values. This is an important point. Asking users why the need notes and how they use them is very enlightening. In my case, I've completely re-factored some schema designs to eliminate the need for the note field. The resulting application allows to users to easily identify the set of records that met a criteria that was formally stored as messages in user notes. If you have an attribute that holds “notes”, there’s not much you can do with a set of such values.

This is an important point. Asking users why the need notes and how they use them is very enlightening. In my case, I’ve completely re-factored some schema designs to eliminate the need for the note field. The resulting application allows to users to easily identify the set of records that met a criteria that was formally stored as messages in user notes.

]]>