Re: assigning codes to events

From: Roger Spencelayh <spencelayh_at_nospam.hotmail.com>
Date: Wed, 19 Jun 2002 07:57:07 +0100
Message-ID: <VA.0000001f.0c749bcb_at_server1.officesol.co.uk>


In article <d8eb949e.0206181605.6a3361f2_at_posting.google.com>, Chris Cubley wrote:
> To me, this approach seems to violate the first normal form by making
> the ResultCode field non-atomic. It then indicates both that the
> letter was returned and the reason why the letter was returned. Am I
> correct in this or am I misinterpreting the 1NF?
>

I think you're misinterpreting 1NF. If you had result codes of, say, 3 for RTS and 4 for Insufficient Postage, then in the ResultCode field in the Letters table you tried to put 3,4 then that would be non-atomic.

> Whether or not my reasoning as to why I think the second approach is
> flawed is correct, I would like opinions as to the pros and cons of
> either approach and if there are any worthy third options (I'm pretty
> much certain there are)
>

Personally, I would prefer the route taken by your colleague, but only because if this problem arose after the system was up and running, it allows you to fix the problem without any change to the database structure.

The other comment I would make is why use the range of numbers for the codes. If this is to provide a PK, then surely it shouldn't be designed for human interpretation, i.e. numbering from 1 upwards would be fine.

Kind Regards

Roger Spencelayh
Computing Services
Malmesbury
http://www.compservonline.co.uk Received on Wed Jun 19 2002 - 08:57:07 CEST

Original text of this message