Re: A real world example
Date: Sat, 12 Aug 2006 15:26:03 GMT
Message-ID: <fqmDg.39802$pu3.533163_at_ursa-nb00s0.nbnet.nb.ca>
JOG wrote:
> Brian Selzer wrote: >
>>In an earlier thread, Marshall asked for a real-world example, and while
>>this isn't exactly what was asked for, it illustrates the problem. Here's
>>the situation. I have two databases containing orders. One is the
>>customer's database containing purchase orders, lines, schedules and
>>releases. The other is the supplier's database containing sales orders and
>>lines. There should be a 1:1 relationship between the releases in the
>>customer's database and the lines in the supplier's database.
>>
>>If you join the respective tables in each of the databases, you get the
>>following:
>>
>>Customer purchase order detail:
>>{PO#, POLine#, CustPart#, Schedule#, ReqestedDate, RequiredQuantity,
>>ReceivedQuantity}
>>
>>The primary key is {PO#, POLine#, Schedule#, RequestedDate}
>>
>>Supplier sales order detail:
>>{SO#, PO#, SOLine#, Part#, CustPart#, RequestedDate, PromiseDate,
>>RequiredQuantity, ShippedQuantity}
>>
>>The primary key is {SO#, SOLine#},
>>an alternate key is {PO#, CustPart#, RequestedDate, SO#}
>>
>>The first problem is that the customer uses a blanket PO, and therefore,
>>(usually) reuses the same PO# and Line# to order a part--the schedule number
>>differentiates one set of releases from another.
>>
>>The second problem is that the supplier's database doesn't track schedules,
>>so there's no way to differentiate sets of releases, except that the SO#
>>will be different for different schedules.
>>
>>Aside from those there have been keying errors, some rows don't have a
>>customer part #, some rows don't have a PO number, etc.
>>
>>What I've been asked to do is to produce exception reports, showing what is
>>different between the two databases so that changes to purchase orders that
>>appear in the customer's database can be verified after they're entered into
>>the supplier's database.
>
> It may be tiredness, but I found that example hard to digest.
It's hard to digest because it is incomplete and artificial. It seems difficult because the idiot expects a 1:1 correspondence between tuples when none should exist based on the given information. A summary of two relations projected on PO# must reconcile, and that is all. If they must reconcile, then presumably the workers at the sales organization must have kludged their system probably by combining the customer's PO# and Schedule# into the sales PO#.
Supplying common business sense where details were omitted, the total amount invoiced must reconcile with the total amount authorized on the purchase order. The total requested quantities must match and the total quantity shipped must reconcile with the quantity requested and authorized.
If things don't reconcile, someone will have to go through the whole thing line by line and probably also locating the physical material. Forensic studies are necessarily meticulous and labour intensive.
The whole example suggests to me that the sales organization hired a crank like Selzer in the first place who then failed to correctly capture the requirements for progress draws.
However
> if I understand your gist correctly, you are pointing out a situation > where an external entity is identified differently, in two distinct and > separate databases?
It goes deeper than that. Will the purchasing organization accept or pay for shipments they cannot trace to an exact (PO#,Schedule#) ? Why should they pay for something they didn't order? How else do they know they ordered it?
If so, then this will always necessarily require a
> 'situated' sentient-being to act as middleware. After all a db doesn't > represent a universal truth about the real world, it just stores an > encoding of it acceptable enough for a target user to interpret what it > tells them in a useful way. In the end its always the human user > putting the semantic pieces back together. > >
>>My point is that here is a real-world example where the universes of two
>>databases overlap, but the set of attributes used to identify something
>>common to the two universes is different for different databases. I
>>understand that this is a common problem when merging or otherwise
>>connecting databases, and I've run into this numerous times and have it
>>covered, but the fact remains that a similar situation can occur within a
>>single database. With natural keys, that is, keys whose value can be
>>different in successive database states, it is possible for the values of
>>one set of identifying attributes of something in the universe to be
>>different in successive universe states
> > huh? different identifying attributes, different things. How can they > be the same, unless there is an incorrect key choice?
Since when did a natural key become an unstable key? If you haven't figured it out yet, it is impossible to communicate with a crank who makes up his own definitions for words.
A natural key is simply a familiar surrogate. Nothing more. Nothing less. While stability is an important design criterion for choosing keys, both surrogate and natural keys can be stable or unstable.
If his whole argument is that stability is an important design criterion, the appropriate answer is "Well, duh!" http://www.dbdebunk.com/page/page/622344.htm
Liebniz equality,
Some kind of nuts anyway.
>>, and when this new information is
If you haven't figured it out yet, Selzer thinks physical location in
> etc., etc. (I know you've heard this from me before now, so apologies
> for the repetition, but I still can't see how I'm not connecting with
> you on it). The successive database states example, unless i've
> misconstrued it, appears analagous to talking about a company who uses
> a primary key of firstname for its employees relation, only for them to
> realise a year later that they've cocked up when they hire someone with
> a clashing firstname. Thats no mistake in the theory, just in the
> coconuts trying to apply it.
>>imparted to the database, it is possible for there to be propositions in
>>successive database states that should correspond, but cannot because the
>>only relevant set of identifying attributes of something is different in
>>successive universe states.
>
> Again I'm foxed by this Brian. How can propositions with different keys
> correspond between database states? That notion seems nonsensical to
> me. Only entities can 'correspond', and of course they are part of the
> conceptual not logical model right?
>>It doesn't matter how stable a set of
>>identifying attributes is, if there's the slightest chance that its values
>>can be different in successive universe states, you have to assume that they
>>will.
> > Well, only if there is sufficent risk involved to necessitate worrying > about such a situation for that specific database. It is _possible_ > that two people's DNA may match for example, but the chances are so > absurdly infintessimely small that it is of no concern.
Clones are more common than you think. An incidence of 4 per 1000 for identical twins makes them just a little more scarce than Canadians in the world population.
>>The problem is one of relevance. If the DNA of a person is not
>>relevant, but is the only set of attribute values that is guaranteed to
>>remain constant throughout the discussion, then what do you do?
That would be a poor assumption given the existence of chimeras and transplant recipients--not to mention early recipients of stem cell treatments.
If you need
>>to know what was known about a thing, then there are only three choices: (1)
>>use a surrogate for the DNA and make it the primary key,
i.e. Choose a valid candidate key. Familiarity, while also an important design criterion, is irrelevant to the point discussed. After all, a natural key is merely a familiar surrogate.
(2) identify each
>>statement in the database so that it can be discussed in successive database
>>states (in other words, use a surrogate for each statement),
If one has a valid key, the statements already have logical identity. If that changes, it is no longer the same statement.
or (3) define a
>>tuple-level assignment operator (A tuple-level assignment operator would
>>permit the system to correlate tuples in successive database states and to
>>act accordingly. For example, Oracle has a FOR EACH ROW trigger.)
That would be stupid. Physical identification has numerous problems that logical identification obviates.
> Naturally (1) (with that 'if there is sufficient risk' caveat) - after > all, that's what a surrogate is for. A replacement for an unobtainable > distinguishing attribute. It is the only option which makes any sense > to me logically. However you do not specify which you would choose? My > impression from your previous posts is that you would also choose (1) > but would desire it to be hidden? All best, J.
Who can say what the hell he is trying to say? He makes up his own definitions for words and expects everyone to know them. He is an idiot and a crank. Received on Sat Aug 12 2006 - 17:26:03 CEST