Question
Create 'professor_audit_trail' table. Use the code below: use ; create table professor_audit_trail ( id int unsigned primary key auto_increment not null, ProfessorName VARCHAR(255) not
Create 'professor_audit_trail' table. Use the code below:
use ;
create table professor_audit_trail
(
id int unsigned primary key auto_increment not null,
ProfessorName VARCHAR(255) not null,
ProfessorProgram VARCHAR(255) not null
);
Create trigger on professor table which executes whenever a row in professor table is deleted. The deleted professor name and professor program should be stored in the newly created 'professor_audit_trail' table. Note, the ID column in the audit table is NOT the ProfessorId column from the professor table.
Delete the record in the Professor table where the ProfessorId equals 10.
viii. Display the contents of the professor_audit_trail table.
SQL- Drop
Create the necessary DDL commands to drop the index, view and trigger.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Answer First lets create the professoraudittrail table which will be used to store the deleted profe...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started