Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id BF50C9FBEFC for ; Thu, 26 Apr 2007 05:44:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 86288-03 for ; Thu, 26 Apr 2007 05:44:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 783649FBEDD for ; Thu, 26 Apr 2007 05:44:28 -0300 (ADT) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 3C738144238; Thu, 26 Apr 2007 09:44:25 +0100 (BST) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 0CDB82740E9; Thu, 26 Apr 2007 09:44:25 +0100 (BST) Message-ID: <46306668.10506@archonet.com> Date: Thu, 26 Apr 2007 09:44:24 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: Dmitry Turin Cc: PostgreSQL SQL List Subject: Re: Fwd: Re[2]: We all are looped on Internet: request + transport = invariant References: <14110647859.20070413105812@narod.ru> <20070413150936.GA31517@phlogiston.dyndns.org> <1684192906.20070419090827@narod.ru> <20070419134808.GB14187@phlogiston.dyndns.org> <814860828.20070420120819@narod.ru> <4628A08F.9050804@archonet.com> <1177072978.760.40.camel@pampa> <7939450187.20070420185808@narod.ru> <1177095450.760.71.camel@pampa> <1312216062.20070423112045@narod.ru> <1177329421.737.39.camel@pampa> <3817356375.20070424150200@narod.ru> <462DFAD4.7030001@archonet.com> <3512994062.20070425113253@narod.ru> <462F1781.4070501@archonet.com> <4412563734.20070426112805@narod.ru> In-Reply-To: <4412563734.20070426112805@narod.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.619 tagged_above=0 required=5 tests=AWL=-0.970, BAYES_40=-0.185, FORGED_RCVD_HELO=0.135, URIBL_SBL=1.639 X-Spam-Level: X-Archive-Number: 200704/262 X-Sequence-Number: 28262 Dmitry Turin wrote: > Good day, Richard. > > RH> > RH> > RH> > RH> These three flights represent options > RH> > RH> > RH> > > Tag is un-necessary (in point of view of DBMS theory). But that's what you're describing isn't it? 1. A journey (flight_chain) between city A and city Z consists of one or more flights. 2. The next flight has to start at the current city, but there may be several flights to choose from. 3. The last flight must end at city Z. Now stage 2 groups the flights to choose among - you can call it something else, but the equivalent of flight_options is there. > 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. So how do I know it's repeated without grabbing a pencil and paper and scrolling back and fore to compare them? > 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). Are you sure this wouldn't just be easier if you wrote a specialised data-visualiser application? >>> 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 But you're not doing the same thing. >>> 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 :) But you were talking about XML at the time. > 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 ? No, but my boss wants a list of flights from London to Madrid for next Friday, with prices, times etc. > 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. So what does it matter to me as a user whether the site is written in TML+Java or SQL+Java? And if I'm building the site in PHP anyway (and I'm going to need forms/buttons/etc in some language) then what am I gaining from the TML? > 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 >>; Hang on - you're using SQL. Why not just use pgadmin and paste the results from my query if I'm using SQL anyway? > > then you get > > > ... > > > 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. Sorry - you didn't eliminate any code there. > 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. But the transport of the data is trivial, assuming I have a webserver and PHP/Perl/ASP/etc. available. -- Richard Huxton Archonet Ltd