updated sql create and prepare