USING SQL - MySQL Workbench A) Code for a new table called 'StudentNew' with fields - StudentID,
Question:
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.
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall