Re: Simple question on data design...

From: --CELKO-- <71062.1056_at_compuserve.com>
Date: 8 Nov 2001 08:51:08 -0800
Message-ID: <c0d87ec0.0111080851.563d9351_at_posting.google.com>


>> Consider tables with columns that contain data from a limited,
pre-set list or domain, such as: .. <<

Please post real DDL instead of a personal pseudo-code. And stop using those silly 1950's "tbl-" prefixes -- it makes SQL look like FORTRAN II. CREATE TABLE Addresses
(address_id INTEGER NOT NULL PRIMARY KEY,  client_id INTEGER NOT NULL

           REFERENCES Clients(client_id)
           ON DELETE CASCADE
           ON UPDATE CASCADE,

 street CHAR(35) NOT NULL,
 city CHAR(20) NOT NULL,
 state CHAR(2) NOT NULL,
 zip CHAR(5) NOT NULL DEFAULT '00000',
 address_type CHAR(8) NOT NULL DEFAULT 'Primary'

        CHECK (address_type IN ('Primary', 'Billing', 'Shipping', 'Location')),
 ..);

>> (disregarding whether this is a good model or not) ... <<

I cannot ignore the fact that this is a reallllllly Baaaaad design. If I have one and only one address, then your company will record me four times, leading to a redundant, non-normalized design.

>> One could store the data as shown above, or each value could be
represented
by a single letter. The single character value could save space, but requires more work when displaying the data in a meaningful way (by substituting the word represented)... <<

I'd go with the single letter and put a comment about translation being done in the front end. But who cares? The design is flawed and you are asking for the best place to put deck chairs on the Titanic as it sinks.

An address does not hae a type; there is nothing inherit in an address that makes it a billing or shipping or whatever kind of thing. Those are uses for an address, and the address is the value of a data element. Received on Thu Nov 08 2001 - 17:51:08 CET

Original text of this message