I have added a new page to the Example Code section of the website. This example PHP code can be called as a scheduled task via Plesk to automate the execution of SQL scripts at pre-defined intervals.
Please see the following link for further details:
https://www.mikewilcock.com/example-code/tools-and-utilities/plesk_scheduled_task_php_script/