Re: Do Data Models Need to built on a Mathematical Concept?

From: Marshall Spight <mspight_at_dnai.com>
Date: Sun, 04 May 2003 04:39:18 GMT
Message-ID: <WP0ta.3381$pa5.5743_at_rwcrnsc52.ops.asp.att.net>


"Neo" <neo55592_at_hotmail.com> wrote in message news:4b45d3ad.0305031844.39c67aab_at_posting.google.com...
> > > > What are the flaws and limitations you had in mind?
> > >
> > > 1. That all rows of a table have the same number of columns
> > > which leads to the need for NULLs.
> >
> > There is nothing about relations that require nulls.
>
> Yet they routinely occurs in practice.

They occur in SQL. They do not occur in the relational model.

> Is the model not conforming to reality?
> Or is reality not conforming to the model?

Neither is the case. SQL is not conforming to the model.

Implementations often have warts. In Java, an array of type T' is a subtype of an array of type T (where T' is a subtype of T) even though it isn't "in reality." So you can get ArrayStoreException at runtime. It's a bug in the spec, just like nulls occur in the SQL spec.

> IMO, each thing in reality can have different number of attributes
> which does not match the model.

You are confusing domains and relations. This is a common error that is easy to make. It took me a lot of reading and thinking before I figured out why that doesn't work.

If you want to think about "things in reality" (not the best idea) then you should think of them as being individual values in the database. That is, what's in one specific attribute of one specific row of a relation is a "thing in reality." *Not* a row.

Marshall Received on Sun May 04 2003 - 06:39:18 CEST

Original text of this message