TransWikia.com

Schema for scarce goods

Database Administrators Asked by empedokles on September 5, 2020

I have following objects:
(Rooms) which are (available in a certain period of time [in days]).
During the time of availability they can be (booked) by (users). There are basically these four tables. I know that there is a foreign key in (booked) for (users), I also have a foreign key for (rooms) in (booking) and I do have a foreign key of the (room) in (availability). But how can I connect my (availability)-table to avoid that the good is booked on a period of time it isn’t available?

The refered question didn’t lead to an answer in my matter.

To summarize:
(Rooms) – (availability) – (booking) – (User)

I have a hard time figuring out how I set the foreign keys for this transaction.

enter image description here

One Answer

The most relational way is adding a day table. You will be able to join room, availability and day to find out which rooms are available for a certain period.

Answered by Federico Razzoli on September 5, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP