Check out example codes for "trigger vérifier stock". It will help you in understanding the concepts better.

Code Example 1

 
BEGIN
 
UPDATE `product` 
    SET `price` =  NEW.price
    , `quantity` = NEW.quantity 
    , date_modified = NOW() 
    WHERE `product_id` = NEW.product_id;
    AND price > NEW.price 
    AND quantity > 0
;
 
END

Learn ReactJs, React Native from akashmittal.com