Question: USING SQL - MySQL Workbench A) Code for a new table called 'StudentNew' with fields - StudentID, FirstName, LastName, and Marks. StudentID have a unique
USING SQL - MySQL Workbench
A) Code for a new table called 'StudentNew' with fields - StudentID, FirstName, LastName, and Marks. StudentID have a unique number and the primary key. Code for a trigger to give an additional 5 marks to every student's mark inserted in this table. Insert one record into this new table to test the trigger.
B) If a table is created using the following command
CREATE TABLE SalaryBudgets(
total DECIMAL(15,2) NOT NULL
);
Then values are inserted using the below insert command
INSERT INTO SalaryBudgets(total)
SELECT SUM(salary)
FROM Salaries;
Code for AFTER DELETE trigger to update the total salary in the SalaryBudgets table after a row is deleted from the Salaries table.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
