Question: I am trying to create a trigger for a PATIENT table if the patient is younger than 18 to receive an ERROR message age must

I am trying to create a trigger for a PATIENT table if the patient is younger than 18 to receive an ERROR message age must be over 18 to be able to have surgery at this center.

delimiter $$ CREATE TRIGGER Check_dateofbirth BEFORE INSERT ON patient FOR EACH ROW BEGIN IF NEW.dateofbirth < 01-JAN-2003 THEN SET MESSAGE_TEXT = 'ERROR: AGE MUST BE ATLEAST 18 YEARS!'; END IF; END;$$ delimiter;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!