• kevin.l.williams (3/26/2013)


    L' Eomot Inversé (3/26/2013)


    And intensly I dislike the horrible violation of 1NF - code examples like this risk teaching really awful habits to inexperienced people who see them.

    I'm very embarrassed to ask this but how does the code example violate 1NF?

    Look at the construction of the field OrderDetailID in insertion code. You'll see that the orderdetailID (a single column) is constructed as an integer which when written out in decimal notation has the detail number within the order for which it is being created in the LS three digits and the order number in the more significant digits. This violates the principle that a row contains a single atomic value in each column, never multiple values in a single column - because here we have an order number and an order detail detail number both in the same column in each row.

    Tom