0

I am developing a room reservation system.

In this data base, the reservations will be stocked in the table "reservation" this table contains the information about the res ->the res id, the user id(Fk), the room Id... And the start date and end date.

Here is the table with an example of reservation Reservation table

There can be multiple reservations for the same local but not at the same time. So is it possible to put a trigger that ensure that the local is free on INSERT INTO reservation ? And if it's not, it does not insert the new reservation? How exactly could I do it ?

a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843
  • Please provide data as text, not as image. And the table definition as `CREATE TABLE` statement, not as vague prose. And always your version of Postgres. – Erwin Brandstetter May 23 '22 at 02:50

0 Answers0