Results 1 to 1 of 1

Thread: Need help with a query

  1. #1
    Join Date
    Feb 2007
    Posts
    1

    Need help with a query

    I need to Calculate minimal quantity of airplanes of each model that is necessary to perform all flights
    (take into account only those flights, which passenger records are in the Pass_in_trip table).
    Result set: an airport (town), an airline, an airplain model,
    the minimal quantity of airplanes (that is necessary to perform all flights) that was in the airport before starting the flights,
    and the amount of airplanes that was in the airport after all flights.

    Short database description "Airport":

    Database schema consists of 4 tables:
    Company(ID_comp, name)
    Trip(trip_no, id_comp, plane, town_from, town_to, time_out, time_in)
    Passenger(ID_psg, name)
    Pass_in_trip(trip_no, date, ID_psg, place)
    Company table has ID and name of the company, which transports passengers. Trip table has information about trips: trip number, company ID, plane type, departure city, arrival city, departure time, and arrival time. The passenger table has passenger's ID and passenger's name. Pass_in_trip table has information about the flights: trip number, departure date (day), passenger's ID and his place during the flight. We should note that,
    - Any trip is being accomplished every day; duration of a flight is less than a calendar-day (24 hours);
    - Time and date are considered comparatively one time zone;
    - The departure time and the arrival time are given to within a minute;
    - There can be the passengers bearing the same names (for example, Bruce Willis);
    - The place during the flight is a number followed by a letter; the number defines the row number, the letter (a - d) – the place in the row (from the left to the right) in the alphabetical order;


    The script for creating Db and my solution which is not fully correct are in the attachment.
    Attached Files Attached Files
    Last edited by drp; 02-28-2007 at 08:17 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •