db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myrna van Lunteren (JIRA)" <j...@apache.org>
Subject [jira] Closed: (DERBY-1319) Need documentation on the toursdb demo database
Date Thu, 22 Mar 2007 16:51:32 GMT

     [ https://issues.apache.org/jira/browse/DERBY-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Myrna van Lunteren closed DERBY-1319.
-------------------------------------


I'm assuming this one can be closed.

> Need documentation on the toursdb demo database
> -----------------------------------------------
>
>                 Key: DERBY-1319
>                 URL: https://issues.apache.org/jira/browse/DERBY-1319
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Demos/Scripts
>    Affects Versions: 10.2.1.6
>            Reporter: Stan Bradbury
>         Assigned To: Myrna van Lunteren
>            Priority: Minor
>             Fix For: 10.2.1.6
>
>         Attachments: DERBY-1319_20060725.diff, DERBY-1319_20060725_2.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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message