rate_calendar table

The rate_calendar table in the Hotel Booking Database Schema schema has 8 columns, keyed by id, with 2 foreign keys to room_types and rate_plans.

One row per sellable night. This single table answers both what is free and what it costs, which is why availability search stays fast.

Columns (8)

Columns of the rate_calendar table
ColumnTypeConstraintsDescription
iduuidprimary key
room_type_iduuidnot null, references room_types.id
rate_plan_iduuidnot null, references rate_plans.id
stay_datedatenot null
rate_centsintegernot null
rooms_availablesmallintnot null
min_stay_nightssmallint
is_closedbooleannot null

Indexes (2)

  • (room_type_id, rate_plan_id, stay_date) unique
  • (stay_date, is_closed)

Relationships