migrate database queries in load_sco.php