seat_assignments table

The seat_assignments table in the Airline Reservation Database Schema schema has 7 columns, keyed by id, with 3 foreign keys to booking_segments, booking_passengers and seats.

Per segment, not per booking: a connecting journey means a different seat on each leg. The unique key is what stops double-selling 14A.

Columns (7)

Columns of the seat_assignments table
ColumnTypeConstraintsDescription
iduuidprimary key
booking_segment_iduuidnot null, references booking_segments.id
booking_passenger_iduuidnot null, references booking_passengers.id
seat_iduuidnot null, references seats.id
is_paidbooleannot null
amount_minorbigint
assigned_attimestamptznot null

Indexes (2)

  • (booking_segment_id, seat_id) unique
  • (booking_passenger_id)

Relationships