Re: quick FK question

From: Yong Huang <>
Date: Tue, 22 Dec 2009 14:45:42 -0800 (PST)
Message-ID: <>

  • On Tue, 12/22/09, Yong Huang <> wrote:

> Filling in a meaningless value
> ... It's only bad that certain queries need to
> be re-evaluated (unless the business case is such that the
> value is guaranteed to be meaningless),

Correction. I should say unless the value is guaranteed to be meaningless *and also* the usage of this column won't include this meaningless value. So if -1 is used in place of null, "quantity > 3" or "quantity = 3" doesn't need a rewrite. But "quantity < 3" does. So does "nvl(quantity,0)". Of course if this is designed at the beginning, we don't say *re*-write, just say write with extra care. This may be a dangerous requirement for business analysts that directly write SQLs. So education for them becomes more important (for "disciplined use" as said in Codd and Date's debate), or it's necessary to build GUI's for them that hides the SQL in the mid-tier.

Yong Huang       

Received on Tue Dec 22 2009 - 16:45:42 CST

Original text of this message