Re: Fwd: Re[2]: We all are looped on Internet: request + transport = invariant - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Fwd: Re[2]: We all are looped on Internet: request + transport = invariant
Date
Msg-id 462F1781.4070501@archonet.com
Whole thread Raw
In response to We all are looped on Internet: request + transport = invariant  (Dmitry Turin <sql4-en@narod.ru>)
Responses Re: Fwd: Re[2]: We all are looped on Internet: request + transport = invariant  (Dmitry Turin <sql4-en@narod.ru>)
Re: Fwd: Re[2]: We all are looped on Internet: request + transport = invariant  (Dmitry Turin <sql4-en@narod.ru>)
List pgsql-sql
Don't forget to cc: the list.

Dmitry Turin wrote:
> Good day, Richard.
> 
>>> http://sql4.by.ru/site/sql40/en/author/wave_eng.htm
> RH> example 2
> RH> 1. I can see how one flight might follow another, but not contained. Do you
> RH> not need some new object "flight_chain" or similar?
> 
> No !
> Fork is possible, several flights might follow another,
> thus several flights should be inside another.

1. One flight is not "contained" within another though. I board one 
plane, fly, get off, board another, fly, ... - they are sequential not 
contained. If you're trying to represent multiple options you should 
really have something like:
<flight_chain ...>  <flight_options>    <flight...>    <flight...>  These three flights represent options
<flight...> </flight_options>
 
</flight_chain>
How do I get such a structure from a TML query?

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

> RH> 2. Alternatively, the <city> needs to indicate to which it's
> RH> referring either as <startcity>/<endcity> or <city fromto="start"> or
> RH> similar.
> 
> What is 'either as <startcity>/<endcity> or <city fromto="start">' ?

Looking at the resultset, how do I know whether a mentioned city is:
1. the start point of a flight
2. the end point of a flight

> RH> 3. How am I constructing these queries?
> 
> There are five documents on
> http://sql4.by.ru/site/sql40/en/author/index_eng.htm
> 
> RH> The whole point was so I didn't have to learn SQL, yes?
> 
> 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).

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

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

The syntax of your queries is not obvious. I haven't read your guide, 
but you did say that the whole point was *not* to have to learn 
languages. If I'm going to learn only one query language, it'll be SQL 
because everything uses it.

> RH> 4. what use it is to have XML without a schema.
> 
> What is 'XML without a schema' ?
> XML is not stored thing, it is a transport form for scheme.

Umm - xml schemas, that describe valid data for an xml document. 
http://www.w3.org/XML/Schema
http://www.xml.com/pub/a/2001/12/12/schemacompare.html

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

An "inquired tree" how? I'm sat here at my laptop, and I want to get a 
list of flights into a spreadsheet I'm doing for my boss.
1. How do I create my TML query (assuming I haven't read the TML manual, 
because if I can read manuals then SQL is viable)?
2. How do I get my query from my laptop to my database server?
3. How do I get results into the spreadsheet?
> (in reduction case - inquired one table or one view),
> which is finished by '>>' at the end,
> is in output automatically (port #80, HTTP protocol,
> http://sql4.by.ru/site/sql40/en/author/inout_eng.htm
> and
> http://sql4.by.ru/site/sql40/en/author/introduction_eng.htm#http).

You trimmed the first part of my question: "Let's say I want to build a 
holiday website. How does this TML setup avoid me having to write any 
php/perl/etc?"

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

--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Dmitry Turin
Date:
Subject: Re: We all are looped on Internet: request + transport = invariant
Next
From: "Nemo Terry"
Date:
Subject: Which function transform x,y to latitude/longitude?