updated sql in python