Re: Fwd: Re[2]: We all are looped on Internet: request + transport = invariant

From: Dmitry Turin <sql4-en(at)narod(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Fwd: Re[2]: We all are looped on Internet: request + transport = invariant
Date: 2007-04-26 08:31:03
Message-ID: 5012741593.20070426113103@narod.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Good day, Richard.

RH> <flight_chain ...>
RH> <flight_options>
RH> <flight...>
RH> <flight...> These three flights represent options
RH> <flight...>
RH> </flight_options>
RH> </flight_chain>

Tag <flight_options> is un-necessary (in point of view of DBMS theory).

RH> 2. If you nest flights then you'll be forced to repeat data, surely?
RH> Multiple routes could end up mentioning flight id=123 several times and
RH> each time have to repeat all possible options from it.

Yes.
Remember, this is not manner of storing data in DBMS.
This is manner to visualize for man.

RH> I know whether a mentioned city is:
RH> 1. the start point of a flight
RH> 2. the end point of a flight

"city.flight" - city is start point,
"flight.city" - city is end point

>> Nearly: sorting by first section of tree
>> (maybe by second section and so on after that)
>> is not seggested now
>> (user can sort, for examle, in browser by XSL).

RH> Hang on, XSL is *not* easier to understand than SQL.

Yes.
This means, that it's necessary to develop TML
(or HTML:
http://lists.w3.org/Archives/Public/public-html/2007Apr/1380.html).

>> RH> syntax for these queries isn't obvious enough to me
>>
>> What is not-obvious -
>> tree notation or work with fields inside section (record) in tree ?
>> If all of them, what is more not-obvious ?

RH> If I'm going to learn only one query language, it'll be SQL
RH> because everything uses it.

'tablename >>;' is better, than to learn php, perl, its library

>> XML is not stored thing, it is a transport form for scheme.
RH> Umm - xml schemas, that describe valid data for an xml document.
RH> http://www.w3.org/XML/Schema
RH> http://www.xml.com/pub/a/2001/12/12/schemacompare.html

Term "scheme" means "database scheme" to me :)

RH> I'm sat here at my laptop, and I want to get a
RH> list of flights into a spreadsheet I'm doing for my boss.

Your boss will itself solve "task of travelling-salesman" ?
By eyes ?

RH> 1. How do I create my TML query (assuming I haven't read the TML manual,
RH> because if I can read manuals then SQL is viable)?

You start browser and open html-document on site of "list of flights".
Html-documents send XML data to Postgres (to site).
Postgres start function with name "main"
http://sql4.by.ru/site/sql40/en/author/inout_eng.htm
Function execute TML-request (it's made by authors of site !),
and Postgres send results to your browser.
You copy from browser into spreadsheet.

Thus you don't need to write request.
You will write TML-request, if you will author of site.

RH> 3. How do I get results into the spreadsheet?

It depends of data model:
if your get tree - there is no way in general case (i think),
if your get records of only one table/view:

create view x as
select city.name as start, city.name as end, flight.t1, flight.t2, day
from city, flight;
x >>;

then you get

<x start="A" end="B" t1="5.00" t2="7.00" day="monday">
...
<x start="K" end="L" t1="15.00" t2="17.00" day="sunday">

RH> How does this TML setup avoid me having to write any
RH> php/perl/etc?"

Look example about site of "list of flights" above.

RH> We're going to need a form that lets people choose from
RH> a list of start and end cities, pick a date and see a list of flights
RH> (sorted by cost, or length or some such). At present I'll build that
RH> with e.g. PHP + SQL => PostgreSQL. What part of the process does TML
RH> make easier?

You use only SQL and small simple part (simple part !) of TML to
transport data.

P.S.
Soon i add sorting into TML.

P.P.S.
Richard, send letter only to mailing list, not to me.

Dmitry Turin
http://html6.by.ru
http://sql4.by.ru
http://computer2.by.ru

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitry Turin 2007-04-26 08:33:02 Re: We all are looped on Internet: request + transport = invariant
Previous Message Dmitry Turin 2007-04-26 08:28:30 Re: Fwd: Re[2]: We all are looped on Internet: request + transport = invariant