Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!postnews.google.com!not-for-mail
From: neo55592@hotmail.com (Neo)
Newsgroups: comp.databases,comp.databases.object,comp.databases.theory
Subject: Re: Demo: Modelling Cost of Travel Paths Between Towns
Date: 20 Nov 2004 12:10:00 -0800
Organization: http://groups.google.com
Lines: 78
Message-ID: <4b45d3ad.0411201210.7c3381de@posting.google.com>
References: <4b45d3ad.0411071807.4cbd51f0@posting.google.com> <4b45d3ad.0411151332.4acd7159@posting.google.com> <2vugcrF2pespkU1@uni-berlin.de> <4b45d3ad.0411162100.58dedf09@posting.google.com> <301c0qF2qkiqaU1@uni-berlin.de> <4b45d3ad.0411172002.362bcdc4@posting.google.com> <m%%md.5565$%M4.4096@trndny08> <4b45d3ad.0411181208.4894f98a@posting.google.com> <Eu8nd.13215$tI3.9199@trndny01> <4b45d3ad.0411191145.2b92d71b@posting.google.com> <3074fpF2tfiu1U1@uni-berlin.de>
NNTP-Posting-Host: 67.98.161.158
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1100981400 1453 127.0.0.1 (20 Nov 2004 20:10:00 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 20 Nov 2004 20:10:00 +0000 (UTC)
Xref: dp-news.maxwell.syr.edu comp.databases:42070 comp.databases.object:12961 comp.databases.theory:28493

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.

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. 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?

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?
 
Alan: INSERT INTO test VALUES(whatever they are, but name='Neotest1',
age='-1')

Neo: Which RM Db handles "whatever they are"? And your not serious
about age being -1 are you? 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?
