title: How do I implement a trigger that updates a column of another table?
body: <p>Here is a car rental ERD I designed.
  <a href="https://i.stack.imgur.com/jrnmu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jrnmu.png" alt="" /></a></p>
  <p>I'm trying to create an SQL trigger that updates CAR table and SET Car_Status to 'Unavailable' whenever a reservation is made that matches the Car_ID in Car table and Car_ID in Reservation table.</p>
  <p>Also if possible I want to add additional conditions where the it updates to 'Available' if the current system date and time is not within the Hire_StartTime and Hire_Endtime in Reservation and does not fall on the same day of Inv_Date in Invoice table.</p>
  <p>Basically I want the Car_Status to be set as available if the current system date and time does not fall on the same day <strong>AND</strong> within the hire time of reservation of the car.</p>
  <p>I'm sorry if this sounds a bit confusing, english is not my first language I'm new to SQL and not very familiar as to how it works.</p>
  <p>If there is a better way of doing this than using trigger, please tell me how. Thank you.</p>