booking_rooms table

The booking_rooms table in the Hotel Booking Database Schema schema has 9 columns, keyed by id, with 4 foreign keys to bookings, room_types, rate_plans and rooms. 2 columns in booking_guests and booking_room_nights reference it.

One row per room booked, so a family taking two rooms is one booking. assigned_room_id stays null until check-in.

Columns (9)

Columns of the booking_rooms table
ColumnTypeConstraintsDescription
iduuidprimary key
booking_iduuidnot null, references bookings.id
room_type_iduuidnot null, references room_types.id
rate_plan_iduuidnot null, references rate_plans.id
assigned_room_iduuidreferences rooms.id
adultssmallintnot null
childrensmallintnot null
checked_in_attimestamptz
checked_out_attimestamptz

Indexes (2)

  • (booking_id)
  • (assigned_room_id)

Relationships