Re: Does Codd's view of a relational database differ from that ofDate& Darwin? [M.Gittens]

From: Paul <paul_at_test.com>
Date: Tue, 07 Jun 2005 13:31:16 +0100
Message-ID: <42a59394$0$41901$ed2619ec_at_ptn-nntp-reader03.plus.net>


Mikito Harakiri wrote:
> Hear, hear! It totally escapes me how could somebody invent putting
> nonumeric value ("not salaried") into numeric column. For all reporting
> purposes unknown salary is salary equal to 0.

I disagree; suppose 90% of salaries are unknown. Someone does a quick query to get the total estimated salary bill, not realising this. They are going to get a shock when the real thing comes through!

I would have thought that it would be safest to return an "unknown", flagging to the user that there are unkown salaries in the column. Then, having been alerted to that fact, they can proceed to use COALESCE to explicitly treat the NULLs as zero if they want.

But I think (and this is a subjective opinion) that treating unknowns as zeros or empty strings should be manually defined behaviour rather than the default.

And the "salary" column could be thought of not as a numeric column, but as a column that holds the answer to the question: "What is employee X's salary?"

Now adding support for this involves a lot more complication at the domain level, but maybe it's worth it. I guess only experience of using such a system will tell.

Paul. Received on Tue Jun 07 2005 - 14:31:16 CEST

Original text of this message