Thread: new idea

new idea

From
"sql4-en.narod.ru"
Date:
Let me know your opinion about next way of processing and extracting data.
This would very comfortable for delivery xml-data into any program, for example into browser.
Has this idea future ? What are you think ?

1. For exaple, you create SET:

create table a ( id   num      primary key; data float;
);
create table b ( id   num      primary key; ref  num      references a(id); data float;
);
create table c ( id   num      primary key; link num      references b(id); data float;
);
insert into a values (1,     12.3);
insert into b values (10, 1, 23.4);
insert into b values (20, 1, 34.5);
insert into b values (30, 1, 45.6);
insert into c values (100,10,56.7);
insert into c values (101,10,67.8);
insert into c values (200,20,78.9);
insert into c values (201,20,89.1);
insert into c values (300,30,91.2);

Request "a.b.c" (of Tree Manipulation Language :) ) will return the following
(term "SET" means, that first table in request is parental table,
next table is branch table)

<a     id=1   data=12.3> <b   id=10  data=23.4>   <c id=100 data=56.7/>   <c id=101 data=67.8/> </b> <b   id=20
data=34.5>  <c id=200 data=78.9/>   <c id=201 data=89.1/> </b> <b   id=30  data=45.6>   <c id=200 data=91.2/> </b>
 
</a>

2. For exaple, you create RELAY-RACE:

create table a ( id   num      primary key; ref  num      references b(id); data float;
);
create table b ( id   num      primary key; link num      references c(id); data float;
);
create table c ( id   num      primary key; data float;
);
insert into с values (100,    34.5);
insert into b values (10, 100,23.4);
insert into a values (1,  10, 12.3);

Request "a.b.c" will return the following
(term "RELAY-RACE" means, that first table in request is branch table,
next table is parental table)

<a     id=1   data=12.3> <b   id=10  data=23.4>   <c id=100 data=34.5/> </b>
</a>

---

Let's consider more complicated cases.

1. complicated case for "set"

create table a ( id   num      primary key; data float;
);
create table b ( id   num      primary key; ref1 num      references a(id); ref2 num      references a(id); data
float;
);
create table c ( id   num      primary key; lnk1 num      references b(id); lnk2 num      references b(id); data
float;
);
insert into a values (1,        12.3);
insert into a values (2,        23.4);
insert into b values (10, 1, 2, 34.5);
insert into b values (20, 1, 2, 45.6);
insert into b values (30, 1, 2, 56.7);
insert into b values (40, 1, 2, 67.8);
insert into c values (100,10,20,78.9);
insert into c values (101,10,20,89.1);
insert into c values (200,30,40,91.2);
insert into c values (201,30,40,88.8);

Request "a.b/ref1.c/lnk1" will return the following

<a     id=1           data=12.3> <b   id=10  ref2=2  data=34.5>   <c id=100 lnk2=20 data=78.9/>   <c id=101 lnk2=20
data=89.1/></b> <b   id=30  ref2=2  data=56.7>   <c id=200 lnk2=40 data=91.2/>   <c id=201 lnk2=40 data=88.8/> </b>
 
</a>

2. complicated case for "relay-race"

create table a ( id   num      primary key; ref1 num      references b(id); ref2 num      references b(id); data
float;
);
create table b ( id   num      primary key; lnk1 num      references c(id); lnk2 num      references c(id); data
float;
);
create table c ( id   num      primary key; data float;
);
insert into с values (201,        78.9);
insert into с values (200,        67.8);
insert into с values (101,        56.7);
insert into с values (100,        45.6);
insert into b values (20, 200,201,34.5);
insert into b values (10, 100,101,23.4);
insert into a values (1,  10, 20, 12.3);

Request "a/ref1.b/lnk1.c" will return the following

<a     id=1   data=12.3> <b   id=10  data=23.4>   <c id=100 data=45.6/> </b>
</a>




Re: new idea

From
Andrew Sullivan
Date:
On Mon, Apr 09, 2007 at 09:42:24AM +0300, sql4-en.narod.ru wrote:
> Let me know your opinion about next way of processing and extracting data.
> This would very comfortable for delivery xml-data into any program, for example into browser.
> Has this idea future ? What are you think ?

What does this do that inheritance doesn't already do?  I don't think
I see anything.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
Everything that happens in the world happens at some place.    --Jane Jacobs 


Re: new idea

From
Erik Jones
Date:

On Apr 9, 2007, at 7:21 AM, Andrew Sullivan wrote:

On Mon, Apr 09, 2007 at 09:42:24AM +0300, sql4-en.narod.ru wrote:
Let me know your opinion about next way of processing and extracting data.
This would very comfortable for delivery xml-data into any program, for example into browser.
Has this idea future ? What are you think ?

What does this do that inheritance doesn't already do?  I don't think
I see anything.

I don't really even see the need for inheritance here.  This is what most ORMs do at the application level already.

erik jones <erik@myemma.com>
software developer
615-296-0838
emma(r)



Re: new idea

From
Andrew Sullivan
Date:
On Mon, Apr 09, 2007 at 09:11:57AM -0500, Erik Jones wrote:
> 
> I don't really even see the need for inheritance here.  This is what  
> most ORMs do at the application level already.

Wel, sure, but the poster seemed to think that having a way to
represent this in the database was a good thing.  (I'm not actually
convinced even of that.  The whole point of SQL was to move away from
the hierarchical model, and so grafting a lot of hierarchy back onto
it suggests to me that the OP has picked the wrong technology for the
problem at the outset.)

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
In the future this spectacle of the middle classes shocking the avant-
garde will probably become the textbook definition of Postmodernism.                --Brad Holland


Re: new idea

From
Erik Jones
Date:
On Apr 9, 2007, at 9:14 AM, Andrew Sullivan wrote:

> On Mon, Apr 09, 2007 at 09:11:57AM -0500, Erik Jones wrote:
>>
>> I don't really even see the need for inheritance here.  This is what
>> most ORMs do at the application level already.
>
> Wel, sure, but the poster seemed to think that having a way to
> represent this in the database was a good thing.  (I'm not actually
> convinced even of that.  The whole point of SQL was to move away from
> the hierarchical model, and so grafting a lot of hierarchy back onto
> it suggests to me that the OP has picked the wrong technology for the
> problem at the outset.)

You're parenthesized comments were what I was getting at. :)

erik jones <erik@myemma.com>
software developer
615-296-0838
emma(r)