Passenger flight log

  • Thread starter Thread starter David Lawrence
  • Start date Start date
D

David Lawrence

I am trying to create a database which will log the
flights I do as a passenger. I have got a table with
airports and another table with aircraft types. I have
created another table (the Flight Log itself) which needs
to be related to both of the others. From the Flight Log
table I want to be able to select an aircraft from the
Aircraft table, a Departure airport and an Arrival airport
from the Airports table (as well as inputting flight
duration, date etc.) So when I select a Departure airport
and an Arrival airport, I need to retrieve data for both
of these from the Airports table. What I cannot understand
is how do I set up the relationships between these tables?
I'm sorry if this is very basic but any help would be
greatly appreciated.
 
Here's how I figure it:

Aircraft:
AircraftID
AircraftType

Airports:
AirportID
Airport
City
State

Flights:
FlightID
AircraftID
DepartureID 'Links to AirportID
ArrivalID 'Also links to AirportID
DepartureDate
ArrivalDate


Now, the key to doing this in the relationships window is
not to draw two lines from the Airport table to the
Flights table, but rather, add the Airport table to the
window twice. The second instance will show up as
Airports_1. Now, you have two tables and two relatioships.


Chris Nebinger
 
Back
Top