Is the SQL trigger coded correctly?

Is the trigger in the following SQL script correctly worded?

Here is the script.

Partial script is included.

CREATE INDEX StudentProgram ON student(StudentProgram);

USE college;

CREATE VIEW computer_science_students AS

SELECT * FROM college.student

WHERE StudentProgram = 'Computer Science';

create table professor_audit_trail (

id int unsigned primary key auto_increment not null,

ProfessorName VARCHAR(255) not null,

ProgramName VARCHAR(255) not null);

DELIMITER $$

CREATE TRIGGER save_profinfo_upon_delete

   BEFORE DELETE ON professor

   FOR EACH ROW

BEGIN

   INSERT INTO professor_audit_trail

   SET ProfessorName = professor.ProfessorName,

   ProgramName = professor.ProfessorProgram;

END$$

DELIMITER ;

There are no answers yet.
Be the first to answer this question.