Re: Object-oriented thinking in SQL context?

From: Brian Selzer <brian_at_selzer-software.com>
Date: Thu, 18 Jun 2009 23:36:04 -0400
Message-ID: <EID_l.100$iz2.43_at_nlpi070.nbdc.sbc.com>


"paul c" <toledobythesea_at_oohay.ac> wrote in message news:2WB_l.31397$Db2.25345_at_edtnps83...
> Nilone wrote:
>
>> ... On second thought, I suppose the user could just
>> select those tuples directly from the base relation, if they needed
>> them.
>>
>
> If that's what you think, it might be productive to ask why have views in
> the first place? If there is some reason to have them, a further question
> would be should there be logical independence?

There are many reasons, both practical and theoretical to have views. The issue here doesn't just concern views, but updates to views. Logical data independence is not always achievable. To quote Date, ".... The critical issue is whether there exists an unambiguous mapping from the restructured version of the database back to the previous version (i.e., whether the restructuring is reversible), or in other words whether the two versions are <b>information-equivalent</b>. If not, logical data independence is clearly not achievable." from /Introduction/, 8th edition, page 301.

> (If there is no reason, maybe they are in fact a physical device.) If the
> answer to that is "no, just a little bit of independence, with various
> exceptions", then I'd ask what is the point of logical independence, why
> not just dispense with that 'requirement' if it is that incomplete.

Since it cannot always be achieved, then it cannot be an 'requirement,' but when it can be achieved, then it most definitely should. Would you throw away your adjustable wrench because its jaw only opens up to 1 inch?

> There is a rampant affliction among some that is akin to slavery - blind
> reason. It is one thing to apply logic in a vacuum but logic that ignores
> deliberate circumstance is actually pointless.
>
>
> On a recent theme, what about inserting to a view that is a GROUPing of
> some base relvar? Should the 'insert' succeed sometimes but not other
> times?

Yes. It depends upon whether when the set of tuples inserted into the view is mapped to a set of tuples to be inserted into the base relvar, if any of those tuples or combinations of tuples violate a constraint defined on the base relvar. Received on Fri Jun 19 2009 - 05:36:04 CEST

Original text of this message