create events code example
Example: create events
SET GLOBAL event_scheduler=ON;
CREATE EVENT update_status_event
ON SCHEDULE
EVERY 1 DAY
ON COMPLETION NOT PRESERVE ENABLE
COMMENT 'Suspend Phone Service If Remaining Days < 0'
DO
UPDATE phone_services p, user_settings SET p.phone_service_status = 2 WHERE p.phone_service_device <> 'GP' AND p.remaining_days <= 0;