A trigger that insures that the movie cost in the Movie tabl

A trigger that insures that the movie cost in the Movie table is at least 20.00 and not greater than 70.00. sql server

Solution

The trigger with name cost is as follows:

CREATE TRIGGER cost BEFORE UPDATE ON Movie
   FOR EACH ROW
   BEGIN
IF NEW.movie_cost < 20.0 THEN
SET NEW.movie_cost = 20.0;
ELSEIF NEW.movie_cost > 70.0 THEN
SET NEW.movie_cost = 70.0;
END IF;
END;

A trigger that insures that the movie cost in the Movie table is at least 20.00 and not greater than 70.00. sql serverSolutionThe trigger with name cost is as f

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site