[ http://issues.apache.org/jira/browse/DERBY-1319?page=all ]

Myrna van Lunteren updated DERBY-1319:
--------------------------------------

    Attachment: DERBY-1319_20060725.diff

In this patch - DERBY-1319-20060725.diff - I have documented the schema. It was 
harder than I thought - how does one describe a field called CITY_NAME except 
to just write 'name of city'. 
So I'd like some review on this.
I suggest to put the toursdb_readme.html that's in this patch under 
<trunk>/java/demo/toursdb with the rest of the toursdb scripts. I think these 
will, in the .bin distribution, end up under <installdir>/demo/programs. Or is 
there a better location for this file?

Note also, that this only covers the documenting of the schema.
I'll leave it to someone else to provide examples for new users in addition to 
the various examples in the documentation.



> Need documentation on the toursdb demo database
> -----------------------------------------------
>
>                 Key: DERBY-1319
>                 URL: http://issues.apache.org/jira/browse/DERBY-1319
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Demos/Scripts
>    Affects Versions: 10.2.0.0
>            Reporter: Stan Bradbury
>         Assigned To: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-1319_20060725.diff
>
>
> Docuement the toursdb schema and provide examplet queries so toursdb can be 
> used by newbie Derby users.  To jump start this here is a query that 
> demonstrates how to join the tables in the schema to list the with seats 
> available on a given day from one city to another.  It's not pretty - a good 
> candidate for a view. (sans the hardcoded values listed below:  
> This example hardcodes the following string values:
>        Travel Date:  '2004-04-12' ,  Departing city: Copenhagen , Destination 
> city: Paris
> select  f.flight_id, a.airline_full, 
> fa.flight_date|| ' ' || f.depart_time Departing,
>     CAST(orig_city.city_name ||', ' || orig_ctry.country as varchar(30)) as 
> Origin, 
>    f.flying_time Hours, f.arrive_time Arriving,
>    CAST(dest_city.city_name ||', ' || dest_ctry.country as varchar(30))  as 
> Destination
> from flights f, airlines a, countries orig_ctry, cities orig_city, 
>    countries dest_ctry, cities dest_city, flightavailability fa
> where f.flight_id = fa.flight_id and f.segment_number = fa.segment_number
>   and orig_city.airport = f.orig_airport and dest_city.airport = 
> f.dest_airport
>   and orig_city.country_iso_code = orig_ctry.country_iso_code
>   and dest_city.country_iso_code = dest_ctry.country_iso_code
>   and f.flight_id like a.airline || '%'
>    and fa.flight_date = '2004-04-12' 
>   and (a.business_seats - fa.business_seats_taken) > 0
>   and orig_city.city_name = 'Copenhagen' and dest_city.city_name = 'Paris'
> order by f.flight_id, f.segment_number
> NOTE: uses some kludgy formatting tricks
> To cut N paste  the query all at once into IJ set maximumdisplaywidth larger 
> (about 985 characters in the query)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to