beds table

The beds table in the Hospital Management System Database Schema schema has 4 columns, keyed by id, with 1 foreign key to rooms. 1 column in bed_assignments references it.

status is a cached convenience. The authoritative occupancy answer is an open row in bed_assignments.

Columns (4)

Columns of the beds table
ColumnTypeConstraintsDescription
iduuidprimary key
room_iduuidnot null, references rooms.id
labelvarchar(20)not null
statusbed_statusnot null

Indexes (2)

  • (room_id, label) unique
  • (status)

Relationships