Variable

Report a typo

Select the correct number of the construction to create a new trigger for the variable @total_weight for the ship table.

1.

CREATE TRIGGER sum_weight
AFTER INSERT ON ship 
FOR EACH ROW
SET @total_weight = @total_weight + NEW.weight;

2.

CREATE NEW TRIGGER sum_weight
AFTER INSERT ON ship
FOR EACH LINE
UPDATE @total_weight SET NEW.weight;

3.

INSERT INTO ship
TRIGGER sum_weight
AFTER INSERT ON ship
FOR EACH LINE
UPDATE @total_weight SET NEW.weight;
Select one option from the list
___

Create a free account to access the full topic