reviews table

The reviews table in the Hotel Booking Database Schema schema has 12 columns, keyed by id, with 3 foreign keys to bookings, properties and guests.

Unique on booking_id, so only a real completed stay can leave a review. That is the whole anti-fake-review mechanism.

Columns (12)

Columns of the reviews table
ColumnTypeConstraintsDescription
iduuidprimary key
booking_iduuidunique, not null, references bookings.id
property_iduuidnot null, references properties.id
guest_iduuidnot null, references guests.id
overall_ratingsmallintnot null
cleanliness_ratingsmallint
location_ratingsmallint
value_ratingsmallint
titlevarchar(160)
bodytext
statusreview_statusnot null
created_attimestamptznot null

Indexes (1)

  • (property_id, status)

Relationships