Re: Basic question?What 's the key if there 's no FD(Functional Dependencies)?
Date: 7 Nov 2006 22:36:36 -0800
Message-ID: <1162967796.208252.232120_at_k70g2000cwa.googlegroups.com>
NENASHI, Tegiri wrote:
> Aloha Kakuikanu wrote:
> > NENASHI, Tegiri wrote:
> > > Aloha Kakuikanu wrote:
> > > > 2. Is the view
> > > >
> > > > select name, 'RMI' 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
> > > > )
> > > >
> > > > updatable?
> > > >
> > Seriously, this second view is perfectly updatable.
>
> This second view is perfectly non-updatable.
>
> Let 'i' be the impostors, 'r' the real people, '+' the union,' -' the
> minus, & the intersect. Suppose r and i are disjoint. Then, (r-i)
> 'rmi' + (i-r) 'ima' + (r&i) 'i' can be simplified to r 'rmi' + i 'ima'.
> You suppose wher the following insert goes, to 'r' or to 'i' ? Why ?
> Suppose one does not know that r and j are disjoint. Where the
> following insert goes, to 'r' or to 'i' ? Why ?
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.
2) A record is inserted into IMR. Nothing gets inserted into RMI and
into I.
3) A record is inserted into I. Nothing inserted into RMI and into IMR.
4) Any superposition of 1-3.
... more cases see below
> >Suppose we insert
> > 'JanHidders' into the RealPeople. Then, in the view we see that a
> > record
> >
> > {(name='JanHidders', typ='RMI')}
> >
> > is added. (The "typ" is the name of the second attribute in the view --
> > I forgot to put an alias in the view definition).
> >
> > Now we have one more record in the set
> >
> > RealPeople minus Impostors
> >
>
> "Suppose we insert 'JanHidders' into the RealPeople" and suppose
> 'JanHidders' is an impostor and exists in 'i'.
This is impossible:
RMI, IMR and I are mutually disjoint. Draw a Venn diagramm if you
aren't convinced.
What you might want to do is to consider additional cases:
5. Delete record from RMI and insert it into I.
Keep in mind that I considered only one case. Yet whatever transaction on tables RealPeople and Impostors you perform, knowing how is reflected on RMI, IMR and I sets is sufficient for translating it back to base tables. Received on Wed Nov 08 2006 - 07:36:36 CET