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 ?