fares table

The fares table in the Airline Reservation Database Schema schema has 9 columns, keyed by id, with 2 foreign keys to routes and fare_classes. 2 columns in fare_rules and tickets reference it.

A priced fare on a route, valid for a date window. Fares are never edited in place: a new price is a new row with a new validity window.

Columns (9)

Columns of the fares table
ColumnTypeConstraintsDescription
iduuidprimary key
route_iduuidnot null, references routes.id
fare_class_iduuidnot null, references fare_classes.id
fare_basisvarchar(12)not null
base_amount_minorbigintnot null
tax_amount_minorbigintnot null
currencychar(3)not null
valid_fromdatenot null
valid_todate

Indexes (2)

  • (route_id, fare_class_id, valid_from)
  • (fare_basis)

Relationships