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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| room_id | uuid | not null, references rooms.id | |
| label | varchar(20) | not null | |
| status | bed_status | not null |
Indexes (2)
(room_id, label)unique(status)
Relationships
beds.room_idreferencesrooms.idbed_assignments.bed_idreferencesbeds