Adding updated sql