Question: I did set the code as if l am wrong as -- Unit 14 - Triggers -- Unit 14.1 'Ali', 'Alrahem', 'S00879581@acad.tri-c.edu', 'M DELIMITER //
I did set the code as if l am wrong as
-- Unit 14 - Triggers -- Unit 14.1 'Ali', 'Alrahem', 'S00879581@acad.tri-c.edu', 'M
DELIMITER // CREATE TRIGGER Student_Before_Update BEFORE UPDATE ON student FOR EACH ROW BEGIN UPDATE student SET EnrolledDate = Date(now()) WHERE ID =1; UPDATE student SET EnrolledDate = DATE_ADD(NOW(), INTERVAL 1 DAY) WHERE ID =1; IF EnrolledDate != NEW.ID THEN SIGNAL SQLSTATE 'HY000' SET MESSAGE_TEXT = 'Enrolled date may not in the future'; END IF; END//
the question as follw but l have syntex error

there is soamthing wrong with my written code so which data to set based on student table

maby l am coding the wrong infrmation based on the requred as
Screen shot of the Output Window showing the output both UPDATE statements
SQL that creates your trigger
Screen shot of the Output Window showing the output with the error.
[10] For this step, write a before update trigger that prevents an update to the student table if the EnrolledDate is in the future. Name the trigger Student_Before Update. If the date is in the future, create a SQL signal and error with the message: "Enrolled date may not be in the future." 2. After you've created the trigger, run this SQL UPDATE Student SET EnrolledDate DATE (now)) WHERE ID = 1 ; UPDATE Student SET EnrolledDate = DATE ADD(NOW(),INTERVAL 1 DAY) WHERE ID 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
