Re: Basic question?What 's the key if there 's no FD(Functional Dependencies)?

From: Aloha Kakuikanu <aloha.kakuikanu_at_yahoo.com>
Date: 8 Nov 2006 15:13:03 -0800
Message-ID: <1163027583.754208.312170_at_m7g2000cwm.googlegroups.com>


NENASHI, Tegiri wrote:
> Aloha Kakuikanu wrote:
> > OK. I have to do complete case-by-case analysis:
> > 1) A record is inserted into RMI. Nothing gets inserted into IMR and
> > into I.
>
> This is different of your preceding question. You have never said that
> you insert into RMI. Please you must learn how to pose questions
> correctly.

It is not different. I have a view

view AllPosters
select name, 'RMI' AS typ from (
  select name from RealPeople
  minus
  select name from Impostors
)
union
select name, 'IMR' from (
  select name from Impostors
  minus
  select name from RealPeople
)
union
select name, 'I' from (
  select name from RealPeople
  intersect
  select name from Impostors
)

with 2 columns "name" and "typ" which is equivalent to the system of three views "RMI", "IMR" and "I". Whenever I insert into that view, this action can be unambiguously interpreted as actions on those 3 views. E.g.:

insert ('JanHidders', 'RMI') into AllPosters

is translated into

insert ('JanHidders') into RMI
-- no action on IMR
-- no action on I

This in turn is unambiguously translated into into an action on base tables

insert ('JanHidders') into RealPeople
-- no action on Imposters

Kind of obvious, isn't it?

> The insertion of record is possible only when the realpeople and
> impostors are disjoint. You have never said that they are. It was me
> who made the supposition. Please ask the question correctly.

There is no such an assumption. You perform a sequence insertions/deletions from "RMI", "IMR" and "I" in a single transaction, and those actions can be easily interpreted on the base tables just like in the insertion example above.

Please note, that the actions should be consistent. For example, you can not do

insert ('JanHidders', 'RMI') into AllPosters; insert ('JanHidders', 'IMR') into AllPosters; commit;

because no transaction on the base tables could produce such result on the view.

> > > "Suppose we insert 'JanHidders' into the RealPeople" and suppose
> > > 'JanHidders' is an impostor and exists in 'i'.

In other words, we have a tuple

('JanHidders', 'I')

in the AllPeople view already, and we do

insert ('JanHidders', 'IMR') into AllPosters;

?

Clearly, if we have have a tuple ('JanHidders', 'I') in the view, then there is a tuple ('JanHidders') in RealPeople base table and a duplicate tuple in Impostors. Now tell me what transaction are you trying to commit in terms of the base tables. Because, I have no way to interpret it as a consistent action. Maybe you do empty transaction?

> >
> > What you might want to do is to consider additional cases:
> >
> > 5. Delete record from RMI and insert it into I.
> >
>
> The view is not delete updatable. How do you decide from what table to
> delete ? One can not decide.

Same as in insert case. Remember, in my view each name is labeled with a "typ". Therefore, for every atomic insert/delete I know what partition of Venn diagramm should be affected. If I delete from the "I" for example, then the record is deleted from both RealPeople and Impostors (pun intended).

> This remark can be correct but the transactions are not connected to
> your questions. Do you want to talk about transacions ? We can talk
> about them, also.

By transaction I have a sequence of deletes/inserts, nothing more. Received on Thu Nov 09 2006 - 00:13:03 CET

Original text of this message