Hotel bookings
hotels, rooms, guests, bookings and payments. 7 tables, 26 columns, no data.
The map
Each line runs from a linking column (N) to the key it points at (1). The same tables are listed below as text.
The tables
hotels
idbigintPKnamevarchar(200) requiredcityvarchar(100) required
room_types
idbigintPKnamevarchar(200) requiredmax_guestssmallint required
rooms
idbigintPKhotel_idbigint→ hotels requiredroom_type_idbigint→ room_types requirednumbervarchar(10) required
guests
idbigintPKfull_namevarchar(200) requiredemailvarchar(255)
bookings
idbigintPKguest_idbigint→ guests requiredroom_idbigint→ rooms requiredcheck_indate requiredcheck_outdate required
payments
idbigintPKbooking_idbigint→ bookings requiredamountnumeric(12,2) requiredpaid_attimestamptz required
rates
idbigintPKroom_type_idbigint→ room_types requirednightlynumeric(12,2) requiredvalid_fromdate required
What you could look at in SSDO
- Ask what happens to bookings if rooms changes.
- Run a scenario in App Simulation on bookings.
- Open Code from structure and generate TypeScript types for the whole sample.
Create a free workspace and open this sample All samples
PK is a primary key. “→ table” is a link (a foreign key) to that table. This page is a description of a structure we wrote; it holds no rows.