Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> comp.databases.theory -> Re: All hail Neo!
David Cressey wrote:
> "Marshall Spight" <marshall.spight_at_gmail.com> wrote in message
>> David Cressey wrote:
>>> "Marshall Spight" <marshall.spight_at_gmail.com> wrote in message
[..]
> I was thinking of something somewhat less subtle. If the average function
> is asked to compute the average of a column of four values and one null,
> there are three ways it could be implemented:
>
> A) report an exception
> B) add up the four values, and divide by four.
> C) add up the four values, and divide by five.
>
> I think we can all agree that alternative C is not useful. Some people
> prefer A. I prefer B.
> Both Excel and SQL, to my knowledge, implement choice B. That's what I was
> referring to, when I suggested doing the experiment with avg.
I have learnt that instead of considering the idiosyncrcies of an implementation, it is often helpful to rewind right back to the propositions that it is modelling. e.g.:
With just this information, a system lacking situated knowledge has no idea if very person even _has_ an age. In fact , given CWA, it would assume the opposite - that sam has no age. So asking "what is the average age" would sensibly yield 30.
With RM, by defining a relation we are, in fact, adding the extra proposition:
In terms of logic the question "What is the average age" is now unanswerable. In terms of predicates there is still a free variable floating about in the final statement, if we're using (name:x, age:y) relation, and no fulfilled proposition exists. Logic hence implies that we can only ask "What is the average age of the people whose age we know" if we want an answer at all (this doesn't mean stooping to using an SQL "not null" - decomposing the table and performing an inner join gives the exact same effect).
As such it does not matter what we want the result to be in a specific case, and relying on adjusting a model's responses in ad-hoc fashion after the event. We either use a system based on logic or we don't. And if we do (we do don't we?) we ask it the correct questions. Received on Thu Apr 27 2006 - 12:32:16 CDT