I wrote the script in standard SQL that included declaring several variables and using loop to replace data in multiple tables and set it to be scheduled query in Big query.