I am trying to create a trigger to give a discount of 10% of the field 'totalCost' in the bookings table, if the 'statusname' is regular in the Passengers table. Below is what I have come up with so far. But I know its wrong. Can you please help?
create or replace TRIGGER Ten_Percent_Discount
BEFORE UPDATE ON Bookings
FOR EACH ROW
UPDATE Bookings b
SET b.TotalCost = 0.10 * TotalCost
WHERE Passengers.StatusName = 'Regular';