flights table

The flights table in the Airline Reservation Database Schema schema has 12 columns, keyed by id, with 2 foreign keys to routes and aircraft. 6 columns in flight_status_events, crew_assignments, flight_inventory, booking_segments and 2 more reference it.

One dated instance of a route. aircraft_id is nullable because tail assignment happens close to departure and can change.

Columns (12)

Columns of the flights table
ColumnTypeConstraintsDescription
iduuidprimary key
route_iduuidnot null, references routes.id
aircraft_iduuidreferences aircraft.id
departure_datedatenot null
scheduled_departuretimestamptznot null
scheduled_arrivaltimestamptznot null
estimated_departuretimestamptz
actual_departuretimestamptz
actual_arrivaltimestamptz
statusflight_statusnot null
gatevarchar(10)
terminalvarchar(10)

Indexes (3)

  • (route_id, departure_date) unique
  • (departure_date, status)
  • (scheduled_departure)

Relationships