Re: Demo: Modelling Cost of Travel Paths Between Towns

From: Alan <not.me_at_uhuh.rcn.com>
Date: Sat, 20 Nov 2004 22:30:29 GMT
Message-ID: <9APnd.3889$sX5.1221_at_trndny05>


"Neo" <neo55592_at_hotmail.com> wrote in message news:4b45d3ad.0411201210.7c3381de_at_posting.google.com...
> Summarization:
>
> Goal: To demo XDb2's flexibility compared to RM. In particular, to
> show XDb2's query ("SELECT %.age & %.name=john;") to find any thing
> with age and name john, written once at design-time, continues to work
> forever regardless of what things have to be represented later.

Still continuing to change the rules as your challenges are met, I see. An old trick of yours that didn't work before and still doesn't.

>
> Neo: Assume RMDM and R2D2 are two robots sent to Mars. They have
> similar hardware, OS and programs except for their dbs. RMDM is based
> on RM and uses your above initial schema as shown below. R2D2 is based
> on XDb2 which doesn't require user to specify a schema.
>
> Alan's initial RM schema:
> CREATE TABLE test (class VARCHAR2() PK, name VARCHAR2() PK, age
> NUMBER);
> INSERT INTO test VALUES (put the values here);
> SELECT * FROM test WHERE age > 0;
> ALTER TABLE age ADD color VARCHAR2(50);
> UPDATE age SET color = 'brown' WHERE class = 'Tree Trunk';
>
> // Query to find things with age and name john ???
> SELECT * FROM test WHERE age > 0;
>
> Neo: Initial schema/query has some errors, please correct. Now suppose
> RMDM and R2D2 meet a martian who doesn't have a name and his age is
> unknown. Here is how R2D2 represents him using XDb2:
>
> CREATE *martian.cls = thing; // Create a martian class
> CREATE *; // Create a thing
> CREATE it.cls = martian; // Classify it as a martian
>
> // Execute query, finds nothing (for now)
> SELECT %.age & %.name=john;
>
> Please show how RMDM deals with the above scenario (without NULLs and
> redundancy) starting with corrected initial schema.
>
> Alan: Since I don't know his name, I have no way of uniquely
> identifying him from any other Martian whose name I do not know. You
> don't either.
>
> Neo: In the above scenario, that is all the info available. At the
> moment we are only concerned with representing that which the scenario
> provides. Why are you trying to represent something not given or
> known. It is possible to represent a thing without a name or age. You
> just need to start with a more generic initial schema/query. Try
> again.
>
> Alan: I would need to create an artificial value to assign to his
> name, so I'll call him Neosense1. Maybe one day, he will use his real
> name, and I can issue a simple UPDATE statement.
>
> Neo: Artifical values for NULLs, lead to 3VL.

No, they don't. Having _no_ values for the nulls lead to 3VL.

Do you understand why CJ
> Date's writes "NULLs and 3VL undermine the entire foundation of the
> relational model". If two martians are named "Neosense1", is it true
> or false that they have the same name?

The second Martian has yet to be introduced into the scenario, but let's introduce him now. We don't know this Martian's name either, so he is called Neosense2. Why you would assume the next one would also be assigned Neosense1 is beyond sensible thinking., and demonstrates that you have no idea how the relational model works.

>
> Alan: I don't know what you will do.
>
> Neo: Me neither, we will find out AFTER your updated schema/query.
> Remember, your goal is to write a query to find a thing with age and
> name john, regardless of what RMDM has to represent in the future.
>
> Alan: I also need to add a column to handle the new attribute you just
> found out about (database type)
>
> Neo: No problem, please show you new initial schema and query. You
> don't want to retrieve RMDM from Mars just when he meets his first
> martian do you?

The schema is essentially the same, I already showed it to you in the previous message. (see ALTER TABLE...) I just added the necessary column to the table, as I have shown.

>
> Alan: INSERT INTO test VALUES(whatever they are, but name='Neotest1',
> age='-1')
>
> Neo: Which RM Db handles "whatever they are"?

"Whatever they are" is just shorthand instead of typing out the various values.

 And your not serious
> about age being -1 are you?

<sigh> As mentioned previously, -1 is known by the users and programmers of the system to mean "unknown" instead of using your dreaded NULL. Nulls would have worked just fine in this particular case, but you insisted on not having them, so don't blame me for the -1.

Artifical values for NULLs, lead to 3VL.
> Do you understand why CJ Date's writes "NULLs and 3VL undermine the
> entire fuoundation of the relational model". If two martians have the
> age "-1", is it true or false that they have the same age?

Been discussed. Gene W would just answer, "yes", but I have already gone through the explanation elseqwhere in one of these threads. You can find it somewhere. I am tired of explaining the same thing to you over and over. In fact, go ahead and step oiff the cliff. I cannot prevent you from doing so. At least I tried. Received on Sat Nov 20 2004 - 23:30:29 CET

Original text of this message