Re: How to find Brothers and Sisters?
Date: 4 Dec 2006 06:05:06 -0800
> Lennart a écrit :
> > Cimode wrote:
> > > Lennart a écrit :
> > > >drop table persons;
> > > >create table persons (
> > > > name char(10) not null primary key,
> > > > father char(10) references persons on delete restrict,
> > > > gender char(1) not null check (gender in ('M','F'))
> > > > );
> > > While getting demanded results, the above schema is not 1NF.
> > Really, in what way do you think the schema violate 1NF?
> A RTable is a set of facts, true propositions. All predicates must be
> validated by TRUE and represent the SAME segment of reality. In the
> design proposed, it is highly likely that the highest level proposition
> (also known as root) have the root node either be NULL or point to
> itself as opposed to the non root node elements. Therefore it is
> likely to be unormalized design. In a word, there's a 1:0 cardinality
> between parent and sibling. A parent may or may NOT have sibling. A
> sibling may or may NOT have a parent (the root does not have a parent
> by definitions)...
> > /Lennart
I would think this is more a design flaw than the table not formally being in 1NF. No repeating groups. check. Data in the form of a relation. check. Some root entry in 'persons' who has himself or one of his successors as a father... erm.....hold on...
(I think that Marshall once pointed out that the technical term for this is Furturama-NF, where Fry is his own grandfather) Received on Mon Dec 04 2006 - 15:05:06 CET