Re: MV Keys

From: JOG <jog_at_cs.nott.ac.uk>
Date: 2 Mar 2006 06:00:36 -0800
Message-ID: <1141308035.958520.53950_at_u72g2000cwu.googlegroups.com>


Bob Hairgrove wrote:
> On Wed, 1 Mar 2006 12:05:28 +0100, Jon Heggland <heggland_at_idi.ntnu.no>
> wrote:
>[snip]
> OrderID|CustomerID|Item1 |Item2 |Item3 | Item4 (...)
> =================================================================
> 1|foo_123 | apples| pears| bananas| oranges
> 2|bar_123 | pears| bananas| oranges|
> 3|bar_123 | bananas| | |
>
> etc., and this:

This confuses me. Surely both of these examples are 1NF. In the first example item1, item2, etc are different attributes with potentially different semantics attached to them. It may well be a shoddy design but still 1NF.

>
> OrderID|CustomerID|Items
> ================================================
> 1|foo_123 | apples;pears;bananas;oranges
> 2|bar_123 | pears;bananas;oranges
> 3|bar_123 | bananas
>
> Conceptually speaking, I think that most would agree that neither
> example is in 1NF, whereas technically speaking, either the first or
> the second example would be, depending on which textbooks you read,
> but certainly not both.

And here the Items attribute is a datatype of varchar - also clearly 1NF, being a single atomic value. However the user interprets that varchar after extraction is up to them.

A 0-NF would be of the nature:

 OrderID | CustomerID | Item | Item | Item | Item (...)


 ....1   | foo_123    | apples    | pears    | bananas | oranges
 ....2   | bar_123    | pears     | bananas  | oranges |
 ....3   | bar_123    | bananas   |          |         |

Hence Date's statement that a db-relation has to be 1-NF through definition.

>
> --
> Bob Hairgrove
> NoSpamPlease_at_Home.com
Received on Thu Mar 02 2006 - 15:00:36 CET

Original text of this message