Changing work with sql